Class IpScriptFieldType

java.lang.Object
org.elasticsearch.index.mapper.MappedFieldType
org.elasticsearch.index.mapper.IpScriptFieldType
All Implemented Interfaces:
org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment, RuntimeField

public final class IpScriptFieldType
extends MappedFieldType
  • Field Details

  • Method Details

    • typeName

      public java.lang.String typeName()
      Description copied from class: MappedFieldType
      Returns the name of this type, as would be specified in mapping properties
      Specified by:
      typeName in interface RuntimeField
      Specified by:
      typeName in class MappedFieldType
      Returns:
      type of the field
    • valueForDisplay

      public java.lang.Object valueForDisplay​(java.lang.Object value)
      Description copied from class: MappedFieldType
      Given 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:
      valueForDisplay in class MappedFieldType
    • docValueFormat

      public DocValueFormat docValueFormat​(java.lang.String format, java.time.ZoneId timeZone)
      Description copied from class: MappedFieldType
      Return a DocValueFormat that can be used to display and parse values as returned by the fielddata API. The default implementation returns a DocValueFormat.RAW.
      Overrides:
      docValueFormat in class MappedFieldType
    • fielddataBuilder

      public IpScriptFieldData.Builder fielddataBuilder​(java.lang.String fullyQualifiedIndexName, java.util.function.Supplier<SearchLookup> searchLookup)
      Description copied from class: MappedFieldType
      Return a fielddata builder for this field
      Overrides:
      fielddataBuilder in class MappedFieldType
      Parameters:
      fullyQualifiedIndexName - the name of the index this field-data is build for
      searchLookup - a SearchLookup supplier to allow for accessing other fields values in the context of runtime fields
    • existsQuery

      public org.apache.lucene.search.Query existsQuery​(SearchExecutionContext context)
      Overrides:
      existsQuery in class MappedFieldType
    • rangeQuery

      public 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: MappedFieldType
      Generates a query that will only match documents that contain the given value. The default implementation returns a TermQuery over the value bytes, boosted by MappedFieldType.boost().
      Specified by:
      termQuery in class MappedFieldType
    • termsQuery

      public org.apache.lucene.search.Query termsQuery​(java.util.Collection<?> values, SearchExecutionContext context)
      Description copied from class: MappedFieldType
      Build a constant-scoring query that matches all values. The default implementation uses a ConstantScoreQuery around a BooleanQuery whose BooleanClause.Occur.SHOULD clauses are generated with MappedFieldType.termQuery(java.lang.Object, org.elasticsearch.index.query.SearchExecutionContext).
      Overrides:
      termsQuery in class MappedFieldType
    • asMappedFieldType

      public final MappedFieldType asMappedFieldType()
      Description copied from interface: RuntimeField
      Exposes the MappedFieldType backing this runtime field, used to execute queries, run aggs etc.
      Specified by:
      asMappedFieldType in interface RuntimeField
      Returns:
      the MappedFieldType backing this runtime field
    • doXContentBody

      public final void doXContentBody​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Description copied from interface: RuntimeField
      Prints out the parameters that subclasses expose
      Specified by:
      doXContentBody in interface RuntimeField
      Throws:
      java.io.IOException
    • isSearchable

      public final boolean isSearchable()
      Description copied from class: MappedFieldType
      Returns true if the field is searchable.
      Overrides:
      isSearchable in class MappedFieldType
    • isAggregatable

      public final boolean isAggregatable()
      Description copied from class: MappedFieldType
      Returns true if the field is aggregatable.
      Overrides:
      isAggregatable in class MappedFieldType
    • 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: MappedFieldType
      Factory method for range queries.
      Overrides:
      rangeQuery in class MappedFieldType
      relation - 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:
      fuzzyQuery in class MappedFieldType
    • prefixQuery

      public org.apache.lucene.search.Query prefixQuery​(java.lang.String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)
      Overrides:
      prefixQuery in class MappedFieldType
    • wildcardQuery

      public org.apache.lucene.search.Query wildcardQuery​(java.lang.String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)
      Overrides:
      wildcardQuery in class MappedFieldType
    • 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:
      regexpQuery in class MappedFieldType
    • phraseQuery

      public org.apache.lucene.search.Query phraseQuery​(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements)
      Overrides:
      phraseQuery in class MappedFieldType
    • multiPhraseQuery

      public org.apache.lucene.search.Query multiPhraseQuery​(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements)
      Overrides:
      multiPhraseQuery in class MappedFieldType
    • phrasePrefixQuery

      public org.apache.lucene.search.Query phrasePrefixQuery​(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions)
      Overrides:
      phrasePrefixQuery in class MappedFieldType
    • spanPrefixQuery

      public org.apache.lucene.search.spans.SpanQuery spanPrefixQuery​(java.lang.String value, org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context)
      Overrides:
      spanPrefixQuery in class MappedFieldType
    • checkAllowExpensiveQueries

      protected final void checkAllowExpensiveQueries​(SearchExecutionContext context)
    • valueFetcher

      public final ValueFetcher valueFetcher​(SearchExecutionContext context, java.lang.String format)
      Description copied from class: MappedFieldType
      Create a helper class to fetch field values during the FetchFieldsPhase.

      New field types must implement this method in order to support the search 'fields' option. Except for metadata fields, field types should not throw UnsupportedOperationException since this could cause a search retrieving multiple fields (like "fields": ["*"]) to fail.

      Specified by:
      valueFetcher in class MappedFieldType
    • leafFactory

      protected final IpFieldScript.LeafFactory leafFactory​(SearchLookup searchLookup)
      Create a script leaf factory.
    • leafFactory

      protected final IpFieldScript.LeafFactory leafFactory​(SearchExecutionContext context)
      Create a script leaf factory for queries.