public abstract class AbstractFieldMapper<T> extends Object implements FieldMapper<T>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractFieldMapper.Builder<T extends AbstractFieldMapper.Builder,Y extends AbstractFieldMapper> |
static class |
AbstractFieldMapper.CopyTo
Represents a list of fields with optional boost factor where the current field should be copied to
|
static class |
AbstractFieldMapper.Defaults |
static class |
AbstractFieldMapper.MultiFields |
FieldMapper.Loading, FieldMapper.Names
Mapper.BuilderContext, Mapper.TypeParser
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected float |
boost |
protected AbstractFieldMapper.CopyTo |
copyTo |
protected Settings |
customFieldDataSettings |
protected boolean |
docValues |
protected DocValuesFormatProvider |
docValuesFormat |
protected FieldDataType |
fieldDataType |
protected org.apache.lucene.document.FieldType |
fieldType |
protected NamedAnalyzer |
indexAnalyzer |
protected AbstractFieldMapper.MultiFields |
multiFields |
protected FieldMapper.Names |
names |
protected FieldMapper.Loading |
normsLoading |
protected PostingsFormatProvider |
postingsFormat |
protected NamedAnalyzer |
searchAnalyzer |
protected SimilarityProvider |
similarity |
DOC_VALUES_FORMAT
EMPTY_ARRAY
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
AbstractFieldMapper(FieldMapper.Names names,
float boost,
org.apache.lucene.document.FieldType fieldType,
Boolean docValues,
NamedAnalyzer indexAnalyzer,
NamedAnalyzer searchAnalyzer,
PostingsFormatProvider postingsFormat,
DocValuesFormatProvider docValuesFormat,
SimilarityProvider similarity,
FieldMapper.Loading normsLoading,
Settings fieldDataSettings,
Settings indexSettings) |
protected |
AbstractFieldMapper(FieldMapper.Names names,
float boost,
org.apache.lucene.document.FieldType fieldType,
Boolean docValues,
NamedAnalyzer indexAnalyzer,
NamedAnalyzer searchAnalyzer,
PostingsFormatProvider postingsFormat,
DocValuesFormatProvider docValuesFormat,
SimilarityProvider similarity,
FieldMapper.Loading normsLoading,
Settings fieldDataSettings,
Settings indexSettings,
AbstractFieldMapper.MultiFields multiFields,
AbstractFieldMapper.CopyTo copyTo) |
Modifier and Type | Method and Description |
---|---|
float |
boost() |
void |
close() |
protected abstract String |
contentType() |
AbstractFieldMapper.CopyTo |
copyTo()
List of fields where this field should be copied to
|
protected boolean |
customBoost()
Derived classes can override it to specify that boost value is set by derived classes.
|
protected String |
defaultDocValuesFormat() |
abstract FieldDataType |
defaultFieldDataType() |
abstract org.apache.lucene.document.FieldType |
defaultFieldType() |
protected String |
defaultPostingFormat() |
DocValuesFormatProvider |
docValuesFormatProvider() |
protected void |
doXContentBody(XContentBuilder builder,
boolean includeDefaults,
ToXContent.Params params) |
org.apache.lucene.search.Filter |
fieldDataTermsFilter(List values,
QueryParseContext context)
A terms filter based on the field data cache
|
FieldDataType |
fieldDataType() |
org.apache.lucene.document.FieldType |
fieldType() |
org.apache.lucene.search.Query |
fuzzyQuery(String value,
Fuzziness fuzziness,
int prefixLength,
int maxExpansions,
boolean transpositions) |
boolean |
hasDocValues() |
org.apache.lucene.analysis.Analyzer |
indexAnalyzer()
The analyzer that will be used to index the field.
|
org.apache.lucene.util.BytesRef |
indexedValueForSearch(Object value)
Returns the indexed value used to construct search "values".
|
protected static String |
indexOptionToString(org.apache.lucene.index.FieldInfo.IndexOptions indexOption) |
protected static String |
indexTokenizeOptionToString(boolean indexed,
boolean tokenized) |
boolean |
isGenerated()
Returns if this field is only generated when indexing.
|
boolean |
isNumeric() |
boolean |
isSortable() |
void |
merge(Mapper mergeWith,
MergeContext mergeContext) |
String |
name() |
FieldMapper.Names |
names() |
FieldMapper.Loading |
normsLoading(FieldMapper.Loading defaultLoading) |
org.apache.lucene.search.Filter |
nullValueFilter()
Null value filter, returns null if there is no null value associated with the field.
|
void |
parse(ParseContext context) |
protected abstract void |
parseCreateField(ParseContext context,
List<org.apache.lucene.document.Field> fields)
Parse the field value and populate
fields . |
PostingsFormatProvider |
postingsFormatProvider() |
org.apache.lucene.search.Filter |
prefixFilter(Object value,
QueryParseContext context) |
org.apache.lucene.search.Query |
prefixQuery(Object value,
org.apache.lucene.search.MultiTermQuery.RewriteMethod method,
QueryParseContext context) |
org.apache.lucene.search.Query |
queryStringTermQuery(org.apache.lucene.index.Term term)
A term query to use when parsing a query string.
|
org.apache.lucene.search.Filter |
rangeFilter(Object lowerTerm,
Object upperTerm,
boolean includeLower,
boolean includeUpper,
QueryParseContext context) |
org.apache.lucene.search.Query |
rangeQuery(Object lowerTerm,
Object upperTerm,
boolean includeLower,
boolean includeUpper,
QueryParseContext context) |
org.apache.lucene.search.Filter |
regexpFilter(Object value,
int flags,
int maxDeterminizedStates,
QueryParseContext parseContext) |
org.apache.lucene.search.Query |
regexpQuery(Object value,
int flags,
int maxDeterminizedStates,
org.apache.lucene.search.MultiTermQuery.RewriteMethod method,
QueryParseContext context) |
org.apache.lucene.analysis.Analyzer |
searchAnalyzer()
The analyzer that will be used to search the field.
|
org.apache.lucene.analysis.Analyzer |
searchQuoteAnalyzer()
The analyzer that will be used for quoted search on the field.
|
SimilarityProvider |
similarity()
Similarity used for scoring queries on the field
|
boolean |
supportsNullValue() |
org.apache.lucene.search.Filter |
termFilter(Object value,
QueryParseContext context) |
org.apache.lucene.search.Query |
termQuery(Object value,
QueryParseContext context) |
org.apache.lucene.search.Filter |
termsFilter(List values,
QueryParseContext context) |
static String |
termVectorOptionsToString(org.apache.lucene.document.FieldType fieldType) |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
traverse(FieldMapperListener fieldMapperListener) |
void |
traverse(ObjectMapperListener objectMapperListener) |
boolean |
useTermQueryWithQueryString()
Should the field query
FieldMapper.termQuery(Object, org.elasticsearch.index.query.QueryParseContext) be used when detecting this
field in query string. |
Object |
valueForSearch(Object value)
Returns the value that will be used as a result for search.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
value
protected final FieldMapper.Names names
protected float boost
protected org.apache.lucene.document.FieldType fieldType
protected final boolean docValues
protected final NamedAnalyzer indexAnalyzer
protected NamedAnalyzer searchAnalyzer
protected PostingsFormatProvider postingsFormat
protected DocValuesFormatProvider docValuesFormat
protected final SimilarityProvider similarity
protected FieldMapper.Loading normsLoading
protected Settings customFieldDataSettings
protected FieldDataType fieldDataType
protected final AbstractFieldMapper.MultiFields multiFields
protected AbstractFieldMapper.CopyTo copyTo
protected AbstractFieldMapper(FieldMapper.Names names, float boost, org.apache.lucene.document.FieldType fieldType, Boolean docValues, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer, PostingsFormatProvider postingsFormat, DocValuesFormatProvider docValuesFormat, SimilarityProvider similarity, FieldMapper.Loading normsLoading, @Nullable Settings fieldDataSettings, Settings indexSettings)
protected AbstractFieldMapper(FieldMapper.Names names, float boost, org.apache.lucene.document.FieldType fieldType, Boolean docValues, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer, PostingsFormatProvider postingsFormat, DocValuesFormatProvider docValuesFormat, SimilarityProvider similarity, FieldMapper.Loading normsLoading, @Nullable Settings fieldDataSettings, Settings indexSettings, AbstractFieldMapper.MultiFields multiFields, AbstractFieldMapper.CopyTo copyTo)
public FieldMapper.Names names()
names
in interface FieldMapper<T>
public abstract org.apache.lucene.document.FieldType defaultFieldType()
public abstract FieldDataType defaultFieldDataType()
public final FieldDataType fieldDataType()
fieldDataType
in interface FieldMapper<T>
public org.apache.lucene.document.FieldType fieldType()
fieldType
in interface FieldMapper<T>
public float boost()
boost
in interface FieldMapper<T>
public org.apache.lucene.analysis.Analyzer indexAnalyzer()
FieldMapper
indexAnalyzer
in interface FieldMapper<T>
public org.apache.lucene.analysis.Analyzer searchAnalyzer()
FieldMapper
searchAnalyzer
in interface FieldMapper<T>
public org.apache.lucene.analysis.Analyzer searchQuoteAnalyzer()
FieldMapper
searchQuoteAnalyzer
in interface FieldMapper<T>
public SimilarityProvider similarity()
FieldMapper
similarity
in interface FieldMapper<T>
public AbstractFieldMapper.CopyTo copyTo()
FieldMapper
copyTo
in interface FieldMapper<T>
public void parse(ParseContext context) throws IOException
parse
in interface Mapper
IOException
protected abstract void parseCreateField(ParseContext context, List<org.apache.lucene.document.Field> fields) throws IOException
fields
.IOException
protected boolean customBoost()
public void traverse(FieldMapperListener fieldMapperListener)
public void traverse(ObjectMapperListener objectMapperListener)
public Object valueForSearch(Object value)
FieldMapper
valueForSearch
in interface FieldMapper<T>
public org.apache.lucene.util.BytesRef indexedValueForSearch(Object value)
FieldMapper
indexedValueForSearch
in interface FieldMapper<T>
public org.apache.lucene.search.Query queryStringTermQuery(org.apache.lucene.index.Term term)
FieldMapper
queryStringTermQuery
in interface FieldMapper<T>
public boolean useTermQueryWithQueryString()
FieldMapper
FieldMapper.termQuery(Object, org.elasticsearch.index.query.QueryParseContext)
be used when detecting this
field in query string.useTermQueryWithQueryString
in interface FieldMapper<T>
public org.apache.lucene.search.Query termQuery(Object value, @Nullable QueryParseContext context)
termQuery
in interface FieldMapper<T>
public org.apache.lucene.search.Filter termFilter(Object value, @Nullable QueryParseContext context)
termFilter
in interface FieldMapper<T>
public org.apache.lucene.search.Filter termsFilter(List values, @Nullable QueryParseContext context)
termsFilter
in interface FieldMapper<T>
public org.apache.lucene.search.Filter fieldDataTermsFilter(List values, @Nullable QueryParseContext context)
fieldDataTermsFilter
in interface FieldMapper<T>
public org.apache.lucene.search.Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, @Nullable QueryParseContext context)
rangeQuery
in interface FieldMapper<T>
public org.apache.lucene.search.Filter rangeFilter(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, @Nullable QueryParseContext context)
rangeFilter
in interface FieldMapper<T>
public org.apache.lucene.search.Query fuzzyQuery(String value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions)
fuzzyQuery
in interface FieldMapper<T>
public org.apache.lucene.search.Query prefixQuery(Object value, @Nullable org.apache.lucene.search.MultiTermQuery.RewriteMethod method, @Nullable QueryParseContext context)
prefixQuery
in interface FieldMapper<T>
public org.apache.lucene.search.Filter prefixFilter(Object value, @Nullable QueryParseContext context)
prefixFilter
in interface FieldMapper<T>
public org.apache.lucene.search.Query regexpQuery(Object value, int flags, int maxDeterminizedStates, @Nullable org.apache.lucene.search.MultiTermQuery.RewriteMethod method, @Nullable QueryParseContext context)
regexpQuery
in interface FieldMapper<T>
public org.apache.lucene.search.Filter regexpFilter(Object value, int flags, int maxDeterminizedStates, @Nullable QueryParseContext parseContext)
regexpFilter
in interface FieldMapper<T>
public org.apache.lucene.search.Filter nullValueFilter()
FieldMapper
nullValueFilter
in interface FieldMapper<T>
public void merge(Mapper mergeWith, MergeContext mergeContext) throws MergeMappingException
merge
in interface Mapper
MergeMappingException
public PostingsFormatProvider postingsFormatProvider()
postingsFormatProvider
in interface FieldMapper<T>
public DocValuesFormatProvider docValuesFormatProvider()
docValuesFormatProvider
in interface FieldMapper<T>
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws IOException
IOException
protected static String indexOptionToString(org.apache.lucene.index.FieldInfo.IndexOptions indexOption)
public static String termVectorOptionsToString(org.apache.lucene.document.FieldType fieldType)
protected static String indexTokenizeOptionToString(boolean indexed, boolean tokenized)
protected abstract String contentType()
public boolean isNumeric()
isNumeric
in interface FieldMapper<T>
public boolean isSortable()
isSortable
in interface FieldMapper<T>
public boolean supportsNullValue()
supportsNullValue
in interface FieldMapper<T>
public boolean hasDocValues()
hasDocValues
in interface FieldMapper<T>
public FieldMapper.Loading normsLoading(FieldMapper.Loading defaultLoading)
normsLoading
in interface FieldMapper<T>
public boolean isGenerated()
isGenerated
in interface FieldMapper<T>
Copyright © 2009–2015. All rights reserved.