Interface TranslationAware

All Known Subinterfaces:
TranslationAware.SingleValueTranslationAware
All Known Implementing Classes:
And, BinaryLogic, CIDRMatch, EndsWith, Equals, EsqlBinaryComparison, FullTextFunction, GreaterThan, GreaterThanOrEqual, In, InsensitiveBinaryComparison, InsensitiveEquals, IsNotNull, IsNull, Kql, LessThan, LessThanOrEqual, Match, MatchOperator, MultiMatchQueryPredicate, Not, NotEquals, Or, QueryString, Range, RLike, SpatialContains, SpatialDisjoint, SpatialIntersects, SpatialRelatesFunction, SpatialWithin, StartsWith, Term, WildcardLike

public interface TranslationAware
Expressions implementing this interface can get called on data nodes to provide an Elasticsearch/Lucene query.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Subinterface for expressions that can only process single values (and null out on MVs).
  • Method Summary

    Modifier and Type
    Method
    Description
    Translates the implementing expression into a Query.
    boolean
    Indicates whether the expression can be translated or not.
  • Method Details

    • translatable

      boolean translatable(LucenePushdownPredicates pushdownPredicates)
      Indicates whether the expression can be translated or not. Usually checks whether the expression arguments are actual fields that exist in Lucene.
    • asQuery

      Query asQuery(TranslatorHandler handler)
      Translates the implementing expression into a Query. If during translation a child needs to be translated first, the handler needs to be used even if the child implements this interface as well. This is to ensure that the child is wrapped in a SingleValueQuery if necessary.

      So use this:

      Query childQuery = handler.asQuery(child);

      and not this:

      Query childQuery = child.asQuery(handler);