public class LuceneFieldManagerImpl extends AbstractLoggableObject implements LuceneFieldManager
SearchFieldConfiguration for
lucene.Field,
NumericField,
Term,
NumericRangeQuery,
TermRangeQuery| Modifier and Type | Field and Description |
|---|---|
private org.apache.lucene.analysis.Analyzer |
analyzer
The
Analyzer |
private SearchConfigurationHolder<? extends SearchConfiguration> |
configurationHolder |
private Iso8601Util |
iso8601Util
The
Iso8601Util for date fields. |
private Integer |
precisionStep |
PROPERTY_PRECISION_STEP| Constructor and Description |
|---|
LuceneFieldManagerImpl(SearchConfigurationHolder<? extends SearchConfiguration> configurationHolder,
org.apache.lucene.analysis.Analyzer analyzer,
Iso8601Util iso8601Util)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.lucene.document.Fieldable |
createField(String field,
Object value)
This method creates the
field for the given
field (name) and value. |
org.apache.lucene.search.Query |
createPhraseQuery(String field,
String value)
This method creates a phrase query.
|
org.apache.lucene.search.Query |
createRangeQuery(String field,
String minimum,
String maximum,
boolean minimumInclusive,
boolean maximumInclusive)
This method create a range
Query. |
org.apache.lucene.index.Term |
createTerm(String field,
Object value)
This method creates a
Term for the given field with
the given value. |
SearchConfigurationHolder<? extends SearchConfiguration> |
getConfigurationHolder()
This method gets the
SearchConfigurationHolder. |
int |
getPrecisionStep() |
protected SearchFields |
getSearchFields()
This method gets the
SearchFields. |
boolean |
refresh()
Will update
LuceneFieldManager.getPrecisionStep() but not refresh
LuceneFieldManager.getConfigurationHolder(). |
getLoggerprivate final Iso8601Util iso8601Util
Iso8601Util for date fields.private final SearchConfigurationHolder<? extends SearchConfiguration> configurationHolder
getConfigurationHolder()private final org.apache.lucene.analysis.Analyzer analyzer
Analyzerprivate Integer precisionStep
getPrecisionStep()public LuceneFieldManagerImpl(SearchConfigurationHolder<? extends SearchConfiguration> configurationHolder, org.apache.lucene.analysis.Analyzer analyzer, Iso8601Util iso8601Util)
configurationHolder - is the SearchConfigurationHolder.analyzer - the Analyzer.iso8601Util - is the Iso8601Util instance used to handle Date fields.public SearchConfigurationHolder<? extends SearchConfiguration> getConfigurationHolder()
SearchConfigurationHolder.getConfigurationHolder in interface LuceneFieldManagerSearchConfigurationHolder.protected SearchFields getSearchFields()
SearchFields.SearchFields.public int getPrecisionStep()
getPrecisionStep in interface LuceneFieldManagerpublic org.apache.lucene.document.Fieldable createField(String field, Object value)
field for the given
field (name) and value.createField in interface LuceneFieldManagerfield - is the name of the
field to create.value - is the value of the
field to create.public org.apache.lucene.index.Term createTerm(String field, Object value)
Term for the given field with
the given value.createTerm in interface LuceneFieldManagerfield - is the name of the
field(s) to match.value - is the expected value of the
field(s) to match. Please note that this value is a single term
(word) and not text.Term.public org.apache.lucene.search.Query createPhraseQuery(String field, String value)
createPhraseQuery in interface LuceneFieldManagerfield - is the name of the
field(s) to match.value - is the expected phrase of the
field(s) to match.Query.public org.apache.lucene.search.Query createRangeQuery(String field, String minimum, String maximum, boolean minimumInclusive, boolean maximumInclusive)
Query.createRangeQuery in interface LuceneFieldManagerfield - is the name of the
field(s) to match.minimum - is the minimum or infimum value.maximum - is the maximum or supremum value.minimumInclusive - - true if the minimum is
included and matches, false if the minimum
is treated as infimum and only higher values will match.maximumInclusive - - true if the maximum is
included and matches, false if the maximum
is treated as supremum and only lower values will match.Query.NumericRangeQuery,
TermRangeQuerypublic boolean refresh()
LuceneFieldManager.getPrecisionStep() but not refresh
LuceneFieldManager.getConfigurationHolder().
This method refreshes the given object. This can be anything from reloading configuration to rebuilding the
internal state. An invocation of this method may be expensive and should only be invoked as needed. The
implementation of this method should be thread-safe if the object itself is to be used by separate consumers at
all.refresh in interface LuceneFieldManagerrefresh in interface Refreshabletrue if something has changed, false otherwise. If the implementation can not determine the
change it should return true.Copyright © 2001–2016 mmm-Team. All rights reserved.