Package org.elasticsearch.index.mapper
Class GeoPointScriptFieldType
java.lang.Object
org.elasticsearch.index.mapper.MappedFieldType
org.elasticsearch.index.mapper.GeoPointScriptFieldType
- All Implemented Interfaces:
org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment,GeoShapeQueryable,RuntimeField
public final class GeoPointScriptFieldType extends MappedFieldType implements GeoShapeQueryable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.MappedFieldType
MappedFieldType.CollapseType, MappedFieldType.RelationNested classes/interfaces inherited from interface org.elasticsearch.index.mapper.RuntimeField
RuntimeField.ParserNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params -
Field Summary
Fields Modifier and Type Field Description static RuntimeField.ParserPARSERprotected ScriptscriptFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Method Summary
Modifier and Type Method Description MappedFieldTypeasMappedFieldType()Exposes theMappedFieldTypebacking this runtime field, used to execute queries, run aggs etc.protected voidcheckAllowExpensiveQueries(SearchExecutionContext context)org.apache.lucene.search.QuerydistanceFeatureQuery(java.lang.Object origin, java.lang.String pivot, SearchExecutionContext context)voiddoXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)Prints out the parameters that subclasses exposeorg.apache.lucene.search.QueryexistsQuery(SearchExecutionContext context)GeoPointScriptFieldData.BuilderfielddataBuilder(java.lang.String fullyQualifiedIndexName, java.util.function.Supplier<SearchLookup> searchLookup)Return a fielddata builder for this fieldorg.apache.lucene.search.QueryfuzzyQuery(java.lang.Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions, SearchExecutionContext context)org.apache.lucene.search.QuerygeoShapeQuery(org.elasticsearch.geometry.Geometry shape, java.lang.String fieldName, ShapeRelation relation, SearchExecutionContext context)booleanisAggregatable()Returns true if the field is aggregatable.booleanisSearchable()Returns true if the field is searchable.protected GeoPointFieldScript.LeafFactoryleafFactory(SearchExecutionContext context)Create a script leaf factory for queries.protected GeoPointFieldScript.LeafFactoryleafFactory(SearchLookup searchLookup)Create a script leaf factory.org.apache.lucene.search.QuerymultiPhraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements)org.apache.lucene.search.QueryphrasePrefixQuery(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions)org.apache.lucene.search.QueryphraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements)org.apache.lucene.search.QueryprefixQuery(java.lang.String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)protected org.apache.lucene.search.QueryrangeQuery(java.lang.Object lowerTerm, java.lang.Object upperTerm, boolean includeLower, boolean includeUpper, java.time.ZoneId timeZone, DateMathParser parser, SearchExecutionContext context)org.apache.lucene.search.QueryrangeQuery(java.lang.Object lowerTerm, java.lang.Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, java.time.ZoneId timeZone, DateMathParser parser, SearchExecutionContext context)Factory method for range queries.org.apache.lucene.search.QueryregexpQuery(java.lang.String value, int syntaxFlags, int matchFlags, int maxDeterminizedStates, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, SearchExecutionContext context)org.apache.lucene.search.spans.SpanQueryspanPrefixQuery(java.lang.String value, org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context)org.apache.lucene.search.QuerytermQuery(java.lang.Object value, SearchExecutionContext context)Generates a query that will only match documents that contain the given value.java.lang.StringtypeName()Returns the name of this type, as would be specified in mapping propertiesValueFetchervalueFetcher(SearchExecutionContext context, java.lang.String format)Create a helper class to fetch field values during theFetchFieldsPhase.org.apache.lucene.search.QuerywildcardQuery(java.lang.String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)Methods inherited from class org.elasticsearch.index.mapper.MappedFieldType
boost, collapseType, docValueFormat, eagerGlobalOrdinals, extractTerm, failIfNoDocValues, failIfNotIndexed, familyTypeName, getTextSearchInfo, hasDocValues, intervals, isFieldWithinQuery, isStored, meta, name, normalizedWildcardQuery, pointReaderIfPossible, prefixQuery, setBoost, termQueryCaseInsensitive, termsQuery, valueForDisplay, wildcardQueryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.index.mapper.GeoShapeQueryable
geoShapeQueryMethods inherited from interface org.elasticsearch.index.mapper.RuntimeField
name, toXContentMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
PARSER
-
script
-
-
Method Details
-
typeName
public java.lang.String typeName()Description copied from class:MappedFieldTypeReturns the name of this type, as would be specified in mapping properties- Specified by:
typeNamein interfaceRuntimeField- Specified by:
typeNamein classMappedFieldType- Returns:
- type of the field
-
rangeQuery
protected org.apache.lucene.search.Query rangeQuery(java.lang.Object lowerTerm, java.lang.Object upperTerm, boolean includeLower, boolean includeUpper, java.time.ZoneId timeZone, DateMathParser parser, SearchExecutionContext context) -
termQuery
public org.apache.lucene.search.Query termQuery(java.lang.Object value, SearchExecutionContext context)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, boosted byMappedFieldType.boost().- Specified by:
termQueryin classMappedFieldType
-
fielddataBuilder
public GeoPointScriptFieldData.Builder fielddataBuilder(java.lang.String fullyQualifiedIndexName, java.util.function.Supplier<SearchLookup> searchLookup)Description copied from class:MappedFieldTypeReturn a fielddata builder for this field- Overrides:
fielddataBuilderin classMappedFieldType- Parameters:
fullyQualifiedIndexName- the name of the index this field-data is build forsearchLookup- aSearchLookupsupplier to allow for accessing other fields values in the context of runtime fields
-
existsQuery
- Overrides:
existsQueryin classMappedFieldType
-
geoShapeQuery
public org.apache.lucene.search.Query geoShapeQuery(org.elasticsearch.geometry.Geometry shape, java.lang.String fieldName, ShapeRelation relation, SearchExecutionContext context)- Specified by:
geoShapeQueryin interfaceGeoShapeQueryable
-
distanceFeatureQuery
public org.apache.lucene.search.Query distanceFeatureQuery(java.lang.Object origin, java.lang.String pivot, SearchExecutionContext context)- Overrides:
distanceFeatureQueryin classMappedFieldType
-
asMappedFieldType
Description copied from interface:RuntimeFieldExposes theMappedFieldTypebacking this runtime field, used to execute queries, run aggs etc.- Specified by:
asMappedFieldTypein interfaceRuntimeField- Returns:
- the
MappedFieldTypebacking this runtime field
-
doXContentBody
public final void doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOExceptionDescription copied from interface:RuntimeFieldPrints out the parameters that subclasses expose- Specified by:
doXContentBodyin interfaceRuntimeField- Throws:
java.io.IOException
-
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(java.lang.Object lowerTerm, java.lang.Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, java.time.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
-
fuzzyQuery
public org.apache.lucene.search.Query fuzzyQuery(java.lang.Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions, SearchExecutionContext context)- Overrides:
fuzzyQueryin classMappedFieldType
-
prefixQuery
public org.apache.lucene.search.Query prefixQuery(java.lang.String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)- Overrides:
prefixQueryin classMappedFieldType
-
wildcardQuery
public org.apache.lucene.search.Query wildcardQuery(java.lang.String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)- Overrides:
wildcardQueryin classMappedFieldType
-
regexpQuery
public org.apache.lucene.search.Query regexpQuery(java.lang.String value, int syntaxFlags, int matchFlags, int maxDeterminizedStates, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, SearchExecutionContext context)- Overrides:
regexpQueryin classMappedFieldType
-
phraseQuery
public org.apache.lucene.search.Query phraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements)- Overrides:
phraseQueryin classMappedFieldType
-
multiPhraseQuery
public org.apache.lucene.search.Query multiPhraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements)- Overrides:
multiPhraseQueryin classMappedFieldType
-
phrasePrefixQuery
public org.apache.lucene.search.Query phrasePrefixQuery(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions)- Overrides:
phrasePrefixQueryin classMappedFieldType
-
spanPrefixQuery
public org.apache.lucene.search.spans.SpanQuery spanPrefixQuery(java.lang.String value, org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context)- Overrides:
spanPrefixQueryin classMappedFieldType
-
checkAllowExpensiveQueries
-
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 throw
UnsupportedOperationExceptionsince 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.
-