anl.aida.ae.lucene
Class LuceneConsumer
java.lang.Object
org.apache.uima.analysis_component.AnalysisComponent_ImplBase
org.apache.uima.analysis_component.Annotator_ImplBase
org.apache.uima.analysis_component.CasAnnotator_ImplBase
anl.aida.ae.lucene.LuceneConsumer
- All Implemented Interfaces:
- org.apache.uima.analysis_component.AnalysisComponent
public class LuceneConsumer
- extends org.apache.uima.analysis_component.CasAnnotator_ImplBase
UIMA CAS Consumer that writes that writes a CAS' document contents as well
as mapped annotations to a lucene index. The annotations to map are
specified in an XML mapping file.
Methods inherited from class org.apache.uima.analysis_component.CasAnnotator_ImplBase |
getRequiredCasInterface, process |
Methods inherited from class org.apache.uima.analysis_component.Annotator_ImplBase |
getCasInstancesRequired, hasNext, next |
Methods inherited from class org.apache.uima.analysis_component.AnalysisComponent_ImplBase |
batchProcessComplete, destroy, getContext, getResultSpecification, reconfigure, setResultSpecification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MESSAGE_DIGEST
private static final java.lang.String MESSAGE_DIGEST
- See Also:
- Constant Field Values
MAPPING_FILE
public static final java.lang.String MAPPING_FILE
- See Also:
- Constant Field Values
INDEX_DIR
public static final java.lang.String INDEX_DIR
- See Also:
- Constant Field Values
CLEAR_INDEX
public static final java.lang.String CLEAR_INDEX
- See Also:
- Constant Field Values
CACHED_CONTENT_DIR
public static final java.lang.String CACHED_CONTENT_DIR
- See Also:
- Constant Field Values
CREATE_CACHE
public static final java.lang.String CREATE_CACHE
- See Also:
- Constant Field Values
CACHE_OUTPUT_DIR
public static final java.lang.String CACHE_OUTPUT_DIR
- See Also:
- Constant Field Values
CACHE_START_DATE
public static final java.lang.String CACHE_START_DATE
- See Also:
- Constant Field Values
CACHE_LENGTH_DAYS
public static final java.lang.String CACHE_LENGTH_DAYS
- See Also:
- Constant Field Values
KEYWORD_FILTER
public static final java.lang.String KEYWORD_FILTER
- See Also:
- Constant Field Values
CACHE_TS_INTERVAL_DAYS
public static final java.lang.String CACHE_TS_INTERVAL_DAYS
- See Also:
- Constant Field Values
docBuilder
private DocumentBuilder docBuilder
writer
private org.apache.lucene.index.IndexWriter writer
builders
private java.util.List<FieldBuilder> builders
factory
private FieldBuilderFactory factory
cacheDir
private java.lang.String cacheDir
indexDir
private java.lang.String indexDir
startDate
private java.lang.String startDate
outputDir
private java.lang.String outputDir
cacheLengthDays
private int cacheLengthDays
cacheIntervalDays
private int cacheIntervalDays
createCache
private boolean createCache
logger
private org.apache.uima.util.Logger logger
token
private org.apache.lucene.analysis.Token token
keywords
private Keywords keywords
filterCache
private java.lang.Boolean filterCache
LuceneConsumer
public LuceneConsumer()
typeSystemInit
public void typeSystemInit(org.apache.uima.cas.TypeSystem typeSystem)
throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
- Overrides:
typeSystemInit
in class org.apache.uima.analysis_component.CasAnnotator_ImplBase
- Throws:
org.apache.uima.analysis_engine.AnalysisEngineProcessException
deleteFile
private void deleteFile(java.io.File dir)
initialize
public void initialize(org.apache.uima.UimaContext context)
throws org.apache.uima.resource.ResourceInitializationException
- Specified by:
initialize
in interface org.apache.uima.analysis_component.AnalysisComponent
- Overrides:
initialize
in class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
- Throws:
org.apache.uima.resource.ResourceInitializationException
process
public void process(org.apache.uima.cas.CAS cas)
throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
- Specified by:
process
in class org.apache.uima.analysis_component.CasAnnotator_ImplBase
- Throws:
org.apache.uima.analysis_engine.AnalysisEngineProcessException
addKeyword
private void addKeyword(org.apache.lucene.document.Field field,
java.lang.String keywordType,
org.apache.lucene.document.Document doc)
throws java.io.IOException
- Throws:
java.io.IOException
collectionProcessComplete
public void collectionProcessComplete()
throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
- Specified by:
collectionProcessComplete
in interface org.apache.uima.analysis_component.AnalysisComponent
- Overrides:
collectionProcessComplete
in class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
- Throws:
org.apache.uima.analysis_engine.AnalysisEngineProcessException
createCache
private void createCache()
throws java.io.IOException,
AIDAException,
java.text.ParseException
- Throws:
java.io.IOException
AIDAException
java.text.ParseException