## org.apache.mahout.utils.vectors.lucene
Class LuceneIterable

    java.lang.Object
      org.apache.mahout.utils.vectors.lucene.LuceneIterable

All Implemented Interfaces:
  Iterable<Vector>

    public class LuceneIterable

extends Object
implements Iterable<Vector>

A LuceneIterable is an Iterable<Vector> that uses a Lucene index as the source for creating the `Vector`. The Field used to create the Vector currently must have Term Vectors stored for it.

Field Summary
`static double` `NO_NORMALIZING`

Constructor Summary
`LuceneIterable(org.apache.lucene.index.IndexReader reader, String idField, String field, VectorMapper mapper)`
`LuceneIterable(org.apache.lucene.index.IndexReader reader, String idField, String field, VectorMapper mapper, double normPower)` Produce a LuceneIterable that can create the Vector plus normalize it.

Method Summary
`Iterator<Vector>` `iterator()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NO_NORMALIZING

    public static final double NO_NORMALIZING

See Also:
  Constant Field Values

Constructor Detail

### LuceneIterable

    public LuceneIterable(org.apache.lucene.index.IndexReader reader,
                          String idField,
                          String field,
                          VectorMapper mapper)

### LuceneIterable

    public LuceneIterable(org.apache.lucene.index.IndexReader reader,
                          String idField,
                          String field,
                          VectorMapper mapper,
                          double normPower)

  Produce a LuceneIterable that can create the Vector plus normalize it.

  Parameters:
    `reader` - The `IndexReader` to read the documents from.
    `idField` - - The Field containing the id. May be null
    `field` - The field to use for the Vector
    `mapper` - The `VectorMapper` for creating `Vector`s from Lucene's TermVectors.
    `normPower` - The normalization value. Must be greater than or equal to 0 or equal to `NO_NORMALIZING`

Method Detail

### iterator

    public Iterator<Vector> iterator()

  Specified by:
    `iterator` in interface `Iterable<Vector>`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.