org.carrot2.source.lucene
Class LuceneDocumentSourceDescriptor.AttributeBuilder

java.lang.Object
  extended by org.carrot2.source.lucene.LuceneDocumentSourceDescriptor.AttributeBuilder
Enclosing class:
LuceneDocumentSourceDescriptor

public static class LuceneDocumentSourceDescriptor.AttributeBuilder
extends Object

Attribute map builder for the LuceneDocumentSource component. You can use this builder as a type-safe alternative to populating the attribute map using attribute keys.


Field Summary
 Map<String,Object> map
          The attribute map populated by this builder.
 
Constructor Summary
protected LuceneDocumentSourceDescriptor.AttributeBuilder(Map<String,Object> map)
          Creates a builder backed by the provided map.
 
Method Summary
 LuceneDocumentSourceDescriptor.AttributeBuilder analyzer(org.apache.lucene.analysis.Analyzer value)
          Analyzer used at indexing time.
 LuceneDocumentSourceDescriptor.AttributeBuilder analyzer(Class<? extends org.apache.lucene.analysis.Analyzer> clazz)
          Analyzer used at indexing time.
 LuceneDocumentSourceDescriptor.AttributeBuilder directory(Class<? extends org.apache.lucene.store.Directory> clazz)
          Search index Directory.
 LuceneDocumentSourceDescriptor.AttributeBuilder directory(org.apache.lucene.store.Directory value)
          Search index Directory.
 Collection<Document> documents()
           
 LuceneDocumentSourceDescriptor.AttributeBuilder fieldMapper(Class<? extends IFieldMapper> clazz)
          IFieldMapper provides the link between Carrot2 Document fields and Lucene index fields.
 LuceneDocumentSourceDescriptor.AttributeBuilder fieldMapper(IFieldMapper value)
          IFieldMapper provides the link between Carrot2 Document fields and Lucene index fields.
 LuceneDocumentSourceDescriptor.AttributeBuilder keepLuceneDocuments(boolean value)
          Keeps references to Lucene document instances in Carrot2 documents.
 LuceneDocumentSourceDescriptor.AttributeBuilder query(Object value)
          A pre-parsed Query object or a String parsed using the built-in QueryParser over a set of search fields returned from the LuceneDocumentSource.fieldMapper.
 LuceneDocumentSourceDescriptor.AttributeBuilder results(int value)
           
 long resultsTotal()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

public final Map<String,Object> map
The attribute map populated by this builder.

Constructor Detail

LuceneDocumentSourceDescriptor.AttributeBuilder

protected LuceneDocumentSourceDescriptor.AttributeBuilder(Map<String,Object> map)
Creates a builder backed by the provided map.

Method Detail

results

public LuceneDocumentSourceDescriptor.AttributeBuilder results(int value)
See Also:
LuceneDocumentSource.results

resultsTotal

public long resultsTotal()
See Also:
LuceneDocumentSource.resultsTotal

documents

public Collection<Document> documents()
See Also:
LuceneDocumentSource.documents

directory

public LuceneDocumentSourceDescriptor.AttributeBuilder directory(org.apache.lucene.store.Directory value)
Search index Directory. Must be unlocked for reading.

See Also:
LuceneDocumentSource.directory

directory

public LuceneDocumentSourceDescriptor.AttributeBuilder directory(Class<? extends org.apache.lucene.store.Directory> clazz)
Search index Directory. Must be unlocked for reading.

See Also:
LuceneDocumentSource.directory

analyzer

public LuceneDocumentSourceDescriptor.AttributeBuilder analyzer(org.apache.lucene.analysis.Analyzer value)
Analyzer used at indexing time. The same analyzer should be used for querying.

See Also:
LuceneDocumentSource.analyzer

analyzer

public LuceneDocumentSourceDescriptor.AttributeBuilder analyzer(Class<? extends org.apache.lucene.analysis.Analyzer> clazz)
Analyzer used at indexing time. The same analyzer should be used for querying.

See Also:
LuceneDocumentSource.analyzer

fieldMapper

public LuceneDocumentSourceDescriptor.AttributeBuilder fieldMapper(IFieldMapper value)
IFieldMapper provides the link between Carrot2 Document fields and Lucene index fields.

See Also:
LuceneDocumentSource.fieldMapper

fieldMapper

public LuceneDocumentSourceDescriptor.AttributeBuilder fieldMapper(Class<? extends IFieldMapper> clazz)
IFieldMapper provides the link between Carrot2 Document fields and Lucene index fields.

See Also:
LuceneDocumentSource.fieldMapper

query

public LuceneDocumentSourceDescriptor.AttributeBuilder query(Object value)
A pre-parsed Query object or a String parsed using the built-in QueryParser over a set of search fields returned from the LuceneDocumentSource.fieldMapper.

See Also:
LuceneDocumentSource.query

keepLuceneDocuments

public LuceneDocumentSourceDescriptor.AttributeBuilder keepLuceneDocuments(boolean value)
Keeps references to Lucene document instances in Carrot2 documents. Please bear in mind two limitations:

See Also:
LuceneDocumentSource.keepLuceneDocuments


Copyright (c) Dawid Weiss, Stanislaw Osinski