java.lang.Object
org.elasticsearch.index.mapper.MappedFieldType
org.elasticsearch.index.mapper.KeywordScriptFieldType
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.MappedFieldType
MappedFieldType.CollapseType, MappedFieldType.Relation -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Scriptstatic final RuntimeField.Parserprotected final Script -
Constructor Summary
ConstructorsConstructorDescriptionKeywordScriptFieldType(String name, StringFieldScript.Factory scriptFactory, Script script, Map<String, String> meta) -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidapplyScriptContext(SearchExecutionContext context) org.apache.lucene.search.QueryexistsQuery(SearchExecutionContext context) fielddataBuilder(FieldDataContext fieldDataContext) Return a fielddata builder for this fieldorg.apache.lucene.search.QueryfuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions, SearchExecutionContext context) final booleanReturns true if the field is aggregatable.final booleanReturns true if the field is searchable.protected final StringFieldScript.LeafFactoryleafFactory(SearchExecutionContext context) Create a script leaf factory for queries.protected final StringFieldScript.LeafFactoryleafFactory(SearchLookup searchLookup) Create a script leaf factory.org.apache.lucene.search.QuerymultiPhraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements, SearchExecutionContext context) org.apache.lucene.search.QuerynormalizedWildcardQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, SearchExecutionContext context) org.apache.lucene.search.QueryphrasePrefixQuery(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions, SearchExecutionContext context) org.apache.lucene.search.QueryphraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements, SearchExecutionContext context) org.apache.lucene.search.QueryprefixQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context) org.apache.lucene.search.QueryrangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ZoneId timeZone, DateMathParser parser, SearchExecutionContext context) final org.apache.lucene.search.QueryrangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, ZoneId timeZone, DateMathParser parser, SearchExecutionContext context) Factory method for range queries.org.apache.lucene.search.QueryregexpQuery(String value, int syntaxFlags, int matchFlags, int maxDeterminizedStates, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, SearchExecutionContext context) static RuntimeFieldsourceOnly(String name) org.apache.lucene.queries.spans.SpanQueryspanPrefixQuery(String value, org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context) org.apache.lucene.search.QuerytermQuery(Object value, SearchExecutionContext context) Generates a query that will only match documents that contain the given value.org.apache.lucene.search.QuerytermQueryCaseInsensitive(Object value, SearchExecutionContext context) org.apache.lucene.search.QuerytermsQuery(Collection<?> values, SearchExecutionContext context) Build a constant-scoring query that matches all values.typeName()Returns the name of this type, as would be specified in mapping propertiesvoidValidate that this field can be the target ofIndexMetadata.INDEX_ROUTING_PATH.final ValueFetchervalueFetcher(SearchExecutionContext context, String format) Create a helper class to fetch field values during theFetchFieldsPhase.valueForDisplay(Object value) Given a value that comes from the stored fields API, convert it to the expected type.org.apache.lucene.search.QuerywildcardQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context) Methods inherited from class org.elasticsearch.index.mapper.MappedFieldType
checkNoFormat, checkNoTimeZone, collapseType, distanceFeatureQuery, docValueFormat, eagerGlobalOrdinals, extractTerm, failIfNoDocValues, failIfNotIndexed, failIfNotIndexedNorDocValuesFallback, familyTypeName, fuzzyIntervals, getMetricType, getTerms, getTextSearchInfo, hasDocValues, isDimension, isFieldWithinQuery, isIndexed, isStored, mayExistInIndex, meta, name, pointReaderIfPossible, prefixIntervals, prefixQuery, termIntervals, wildcardIntervals, wildcardQuery
-
Field Details
-
PARSER
-
script
-
DEFAULT_SCRIPT
-
-
Constructor Details
-
KeywordScriptFieldType
-
-
Method Details
-
sourceOnly
-
typeName
Description copied from class:MappedFieldTypeReturns the name of this type, as would be specified in mapping properties- Specified by:
typeNamein classMappedFieldType
-
valueForDisplay
Description copied from class:MappedFieldTypeGiven a value that comes from the stored fields API, convert it to the expected type. For instance a date field would store dates as longs and format it back to a string in this method.- Overrides:
valueForDisplayin classMappedFieldType
-
fielddataBuilder
Description copied from class:MappedFieldTypeReturn a fielddata builder for this field- Overrides:
fielddataBuilderin classMappedFieldType- Parameters:
fieldDataContext- the context for the fielddata
-
existsQuery
- Overrides:
existsQueryin classMappedFieldType
-
fuzzyQuery
public org.apache.lucene.search.Query fuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions, SearchExecutionContext context) -
prefixQuery
public org.apache.lucene.search.Query prefixQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context) -
rangeQuery
public org.apache.lucene.search.Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ZoneId timeZone, DateMathParser parser, SearchExecutionContext context) -
regexpQuery
public org.apache.lucene.search.Query regexpQuery(String value, int syntaxFlags, int matchFlags, int maxDeterminizedStates, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, SearchExecutionContext context) -
termQueryCaseInsensitive
public org.apache.lucene.search.Query termQueryCaseInsensitive(Object value, SearchExecutionContext context) - Overrides:
termQueryCaseInsensitivein classMappedFieldType
-
termQuery
Description copied from class:MappedFieldTypeGenerates a query that will only match documents that contain the given value. The default implementation returns aTermQueryover the value bytes- Specified by:
termQueryin classMappedFieldType
-
termsQuery
public org.apache.lucene.search.Query termsQuery(Collection<?> values, SearchExecutionContext context) Description copied from class:MappedFieldTypeBuild a constant-scoring query that matches all values. The default implementation uses aConstantScoreQueryaround aBooleanQuerywhoseBooleanClause.Occur.SHOULDclauses are generated withMappedFieldType.termQuery(java.lang.Object, org.elasticsearch.index.query.SearchExecutionContext).- Overrides:
termsQueryin classMappedFieldType
-
wildcardQuery
public org.apache.lucene.search.Query wildcardQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context) -
normalizedWildcardQuery
public org.apache.lucene.search.Query normalizedWildcardQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, SearchExecutionContext context) - Overrides:
normalizedWildcardQueryin classMappedFieldType
-
isSearchable
public final boolean isSearchable()Description copied from class:MappedFieldTypeReturns true if the field is searchable.- Overrides:
isSearchablein classMappedFieldType
-
isAggregatable
public final boolean isAggregatable()Description copied from class:MappedFieldTypeReturns true if the field is aggregatable.- Overrides:
isAggregatablein classMappedFieldType
-
rangeQuery
public final org.apache.lucene.search.Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, ZoneId timeZone, DateMathParser parser, SearchExecutionContext context) Description copied from class:MappedFieldTypeFactory method for range queries.- Overrides:
rangeQueryin classMappedFieldTyperelation- the relation, nulls should be interpreted like INTERSECTS
-
phraseQuery
public org.apache.lucene.search.Query phraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements, SearchExecutionContext context) - Overrides:
phraseQueryin classMappedFieldType
-
multiPhraseQuery
public org.apache.lucene.search.Query multiPhraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements, SearchExecutionContext context) - Overrides:
multiPhraseQueryin classMappedFieldType
-
phrasePrefixQuery
public org.apache.lucene.search.Query phrasePrefixQuery(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions, SearchExecutionContext context) - Overrides:
phrasePrefixQueryin classMappedFieldType
-
spanPrefixQuery
public org.apache.lucene.queries.spans.SpanQuery spanPrefixQuery(String value, org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context) - Overrides:
spanPrefixQueryin classMappedFieldType
-
applyScriptContext
-
valueFetcher
Description copied from class:MappedFieldTypeCreate a helper class to fetch field values during theFetchFieldsPhase. New field types must implement this method in order to support the search 'fields' option. Except for metadata fields, field types should not throwUnsupportedOperationExceptionsince this could cause a search retrieving multiple fields (like "fields": ["*"]) to fail.- Specified by:
valueFetcherin classMappedFieldType
-
leafFactory
Create a script leaf factory. -
leafFactory
Create a script leaf factory for queries. -
validateMatchedRoutingPath
public void validateMatchedRoutingPath()Description copied from class:MappedFieldTypeValidate that this field can be the target ofIndexMetadata.INDEX_ROUTING_PATH.- Overrides:
validateMatchedRoutingPathin classMappedFieldType
-