public class LuceneSearchEngineBuilder extends AbstractSearchEngineBuilder
SearchEngineBuilder
using apache lucene as underlying search-engine.Modifier and Type | Field and Description |
---|---|
private org.apache.lucene.analysis.Analyzer |
analyzer |
private LuceneFieldManagerFactory |
fieldManagerFactory |
private org.apache.lucene.search.highlight.Formatter |
highlightFormatter |
private LuceneAnalyzer |
luceneAnalyzer |
private LuceneDirectoryBuilder |
luceneDirectoryBuilder |
Constructor and Description |
---|
LuceneSearchEngineBuilder()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
ManagedSearchEngine |
createSearchEngine(org.apache.lucene.index.IndexReader indexReader,
SearchConfigurationHolder<? extends SearchConfiguration> configurationHolder,
PeriodicRefresher refresher)
This method creates a
ManagedSearchEngine for an existing IndexReader . |
ManagedSearchEngine |
createSearchEngine(SearchEngineConfigurationHolder configurationHolder)
This method creates a
ManagedSearchEngine for the given configuration . |
protected void |
doInitialize()
This method performs the actual
initialization . |
protected org.apache.lucene.analysis.Analyzer |
getAnalyzer() |
protected LuceneFieldManagerFactory |
getFieldManagerFactory()
This method gets the
LuceneFieldManagerFactory . |
protected org.apache.lucene.search.highlight.Formatter |
getHighlightFormatter() |
protected LuceneDirectoryBuilder |
getLuceneDirectoryBuilder() |
void |
setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer) |
void |
setFieldManagerFactory(LuceneFieldManagerFactory fieldManagerFactory) |
void |
setHighlightFormatter(org.apache.lucene.search.highlight.Formatter highlightFormatter) |
void |
setLuceneAnalyzer(LuceneAnalyzer luceneAnalyzer)
This method sets (injects) the
LuceneAnalyzer . |
void |
setLuceneDirectoryBuilder(LuceneDirectoryBuilder luceneDirectoryBuilder) |
getPeriodicRefresher, getSearchDependencies, getSearchQueryBuilderFactory, setPeriodicRefresher, setSearchDependencies, setSearchQueryBuilderFactory
createLogger, getLogger
doInitialized, getInitializationState, initialize
private org.apache.lucene.analysis.Analyzer analyzer
getAnalyzer()
private LuceneAnalyzer luceneAnalyzer
setLuceneAnalyzer(LuceneAnalyzer)
private LuceneDirectoryBuilder luceneDirectoryBuilder
getLuceneDirectoryBuilder()
private org.apache.lucene.search.highlight.Formatter highlightFormatter
getHighlightFormatter()
private LuceneFieldManagerFactory fieldManagerFactory
getFieldManagerFactory()
public void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
analyzer
- is the analyzer to setprotected org.apache.lucene.analysis.Analyzer getAnalyzer()
@Inject public void setLuceneAnalyzer(LuceneAnalyzer luceneAnalyzer)
LuceneAnalyzer
. You may also use setAnalyzer(Analyzer)
if
you assemble this component manually.luceneAnalyzer
- is the luceneAnalyzer to set@Inject public void setLuceneDirectoryBuilder(LuceneDirectoryBuilder luceneDirectoryBuilder)
luceneDirectoryBuilder
- is the luceneDirectoryBuilder to setprotected LuceneDirectoryBuilder getLuceneDirectoryBuilder()
protected org.apache.lucene.search.highlight.Formatter getHighlightFormatter()
@Inject public void setHighlightFormatter(org.apache.lucene.search.highlight.Formatter highlightFormatter)
highlightFormatter
- is the highlightFormatter to setprotected LuceneFieldManagerFactory getFieldManagerFactory()
LuceneFieldManagerFactory
.LuceneFieldManagerFactory
.@Inject public void setFieldManagerFactory(LuceneFieldManagerFactory fieldManagerFactory)
fieldManagerFactory
- is the fieldManagerFactory to setprotected void doInitialize()
initialization
. It is called when AbstractComponent.initialize()
is
invoked for the first time. super.
AbstractComponent.doInitialize()
.doInitialize
in class AbstractSearchEngineBuilder
public ManagedSearchEngine createSearchEngine(SearchEngineConfigurationHolder configurationHolder)
ManagedSearchEngine
for the given configuration
.configurationHolder
- is the SearchEngineConfigurationHolder
.ManagedSearchEngine
.SearchEngineConfigurationLoader
public ManagedSearchEngine createSearchEngine(org.apache.lucene.index.IndexReader indexReader, SearchConfigurationHolder<? extends SearchConfiguration> configurationHolder, PeriodicRefresher refresher)
ManagedSearchEngine
for an existing IndexReader
.indexReader
- is the IndexReader
.configurationHolder
- is the SearchConfigurationHolder
.refresher
- is the PeriodicRefresher
or null
to disable auto-refresh.ManagedSearchEngine
.Copyright © 2001–2016 mmm-Team. All rights reserved.