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

java.lang.Object
  extended by org.apache.mahout.utils.vectors.lucene.LuceneIterable
All Implemented Interfaces:
Iterable<Vector>

public final class LuceneIterable
extends Object
implements Iterable<Vector>

Iterable counterpart to LuceneIterator.


Field Summary
static double NO_NORMALIZING
           
 
Constructor Summary
LuceneIterable(org.apache.lucene.index.IndexReader reader, String idField, String field, TermInfo terminfo, Weight weight)
           
LuceneIterable(org.apache.lucene.index.IndexReader indexReader, String idField, String field, TermInfo terminfo, Weight weight, double normPower)
           
LuceneIterable(org.apache.lucene.index.IndexReader indexReader, String idField, String field, TermInfo terminfo, Weight weight, double normPower, double maxPercentErrorDocs)
          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,
                      TermInfo terminfo,
                      Weight weight)

LuceneIterable

public LuceneIterable(org.apache.lucene.index.IndexReader indexReader,
                      String idField,
                      String field,
                      TermInfo terminfo,
                      Weight weight,
                      double normPower)

LuceneIterable

public LuceneIterable(org.apache.lucene.index.IndexReader indexReader,
                      String idField,
                      String field,
                      TermInfo terminfo,
                      Weight weight,
                      double normPower,
                      double maxPercentErrorDocs)
Produce a LuceneIterable that can create the Vector plus normalize it.

Parameters:
indexReader - IndexReader to read the documents from.
idField - field containing the id. May be null.
field - field to use for the Vector
normPower - the normalization value. Must be nonnegative, or NO_NORMALIZING
maxPercentErrorDocs - the percentage of documents in the lucene index that can have a null term vector
Method Detail

iterator

public Iterator<Vector> iterator()
Specified by:
iterator in interface Iterable<Vector>


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.