|
Carrot2 v3.6.0-SNAPSHOT
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.core.ProcessingComponentBase
org.carrot2.source.lucene.LuceneDocumentSource
public final class LuceneDocumentSource
A IDocumentSource fetching Documents from a local Apache Lucene index.
The index should be binary-compatible with the Lucene version actually imported by this
plugin.
| Field Summary | |
|---|---|
org.apache.lucene.analysis.Analyzer |
analyzer
Analyzer used at indexing time. |
org.apache.lucene.store.Directory |
directory
Search index Directory. |
Collection<Document> |
documents
|
IFieldMapper |
fieldMapper
IFieldMapper provides the link between Carrot2
Document fields and Lucene index fields. |
boolean |
keepLuceneDocuments
Keeps references to Lucene document instances in Carrot2 documents. |
static String |
LUCENE_DOCUMENT_FIELD
Carrot2 Document field that stores the original Lucene document instance. |
Object |
query
A pre-parsed Query object or a String
parsed using the built-in QueryParser over a
set of search fields returned from the fieldMapper. |
int |
results
|
long |
resultsTotal
|
| Constructor Summary | |
|---|---|
LuceneDocumentSource()
|
|
| Method Summary | |
|---|---|
protected SearchEngineResponse |
fetchSearchResponse()
Fetch search engine response. |
void |
init(IControllerContext context)
Invoked after component's attributes marked with Init and Input
annotations have been bound, but before calls to any other methods of this
component. |
void |
process()
Performs the processing required to fulfill the request. |
| Methods inherited from class org.carrot2.core.ProcessingComponentBase |
|---|
afterProcessing, beforeProcessing, dispose, getContext, getSharedExecutor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.carrot2.core.IProcessingComponent |
|---|
afterProcessing, beforeProcessing, dispose |
| Field Detail |
|---|
public int results
public long resultsTotal
public Collection<Document> documents
public org.apache.lucene.store.Directory directory
Directory. Must be unlocked for
reading.
public org.apache.lucene.analysis.Analyzer analyzer
Analyzer used at indexing time. The same
analyzer should be used for querying.
public IFieldMapper fieldMapper
IFieldMapper provides the link between Carrot2
Document fields and Lucene index fields.
public Object query
Query object or a String
parsed using the built-in QueryParser over a
set of search fields returned from the fieldMapper.
public boolean keepLuceneDocuments
IFieldMapper that will store those fields as regular
Carrot2 fields.Controller
configured to cache the
output from LuceneDocumentSource.
public static final String LUCENE_DOCUMENT_FIELD
Document field that stores the original Lucene document instance.
Keeping of Lucene document instances is disabled by default. Enable it using the
keepLuceneDocuments attribute.
| Constructor Detail |
|---|
public LuceneDocumentSource()
| Method Detail |
|---|
public void init(IControllerContext context)
IProcessingComponentInit and Input
annotations have been bound, but before calls to any other methods of this
component. After a call to this method completes without an exception, attributes
marked with Init Output will be collected. In this method,
components should perform initializations based on the initialization-time
attributes. This method is called once in the life time of a processing
component instance.
init in interface IProcessingComponentinit in class ProcessingComponentBasecontext - An instance of IControllerContext of the controller to which this
component instance will be bound.
public void process()
throws ProcessingException
IProcessingComponent
process in interface IProcessingComponentprocess in class ProcessingComponentBaseProcessingException - when processing failed. If thrown, the
IProcessingComponent.afterProcessing() method will be called and the component will
be ready to accept further requests or to be disposed of. Finally, the
exception will be rethrown from the controller method that caused the
component to perform processing.
protected SearchEngineResponse fetchSearchResponse()
throws Exception
Exception
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||