Interface Rewriteable<T>

All Known Subinterfaces:
MultiTermQueryBuilder, QueryBuilder, SpanQueryBuilder
All Known Implementing Classes:
AbstractAggregationBuilder, AbstractGeometryQueryBuilder, AbstractHighlighterBuilder, AbstractPercentilesAggregationBuilder, AbstractPipelineAggregationBuilder, AbstractQueryBuilder, AbstractRangeBuilder, AdjacencyMatrixAggregationBuilder, AggregationBuilder, AliasFilter, AutoDateHistogramAggregationBuilder, AvgAggregationBuilder, AvgBucketPipelineAggregationBuilder, BaseTermQueryBuilder, BoolQueryBuilder, BoostingQueryBuilder, BucketMetricsPipelineAggregationBuilder, BucketScriptPipelineAggregationBuilder, BucketSelectorPipelineAggregationBuilder, BucketSortPipelineAggregationBuilder, CardinalityAggregationBuilder, CombinedFieldsQueryBuilder, CommonTermsQueryBuilder, CompositeAggregationBuilder, ConstantScoreQueryBuilder, CumulativeSumPipelineAggregationBuilder, DateHistogramAggregationBuilder, DateRangeAggregationBuilder, DerivativePipelineAggregationBuilder, DisMaxQueryBuilder, DistanceFeatureQueryBuilder, DiversifiedAggregationBuilder, ExistsQueryBuilder, ExtendedStatsAggregationBuilder, ExtendedStatsBucketPipelineAggregationBuilder, FieldMaskingSpanQueryBuilder, FieldSortBuilder, FilterAggregationBuilder, FiltersAggregationBuilder, FunctionScoreQueryBuilder, FuzzyQueryBuilder, GeoBoundingBoxQueryBuilder, GeoBoundsAggregationBuilder, GeoCentroidAggregationBuilder, GeoDistanceAggregationBuilder, GeoDistanceQueryBuilder, GeoDistanceSortBuilder, GeoGridAggregationBuilder, GeoHashGridAggregationBuilder, GeoPolygonQueryBuilder, GeoShapeQueryBuilder, GeoTileGridAggregationBuilder, GlobalAggregationBuilder, HighlightBuilder, HighlightBuilder.Field, HistogramAggregationBuilder, IdsQueryBuilder, IntervalQueryBuilder, IpRangeAggregationBuilder, MatchAllQueryBuilder, MatchBoolPrefixQueryBuilder, MatchNoneQueryBuilder, MatchPhrasePrefixQueryBuilder, MatchPhraseQueryBuilder, MatchQueryBuilder, MaxAggregationBuilder, MaxBucketPipelineAggregationBuilder, MedianAbsoluteDeviationAggregationBuilder, MinAggregationBuilder, MinBucketPipelineAggregationBuilder, MissingAggregationBuilder, MoreLikeThisQueryBuilder, MovAvgPipelineAggregationBuilder, MovFnPipelineAggregationBuilder, MultiMatchQueryBuilder, MultiValuesSourceAggregationBuilder, MultiValuesSourceAggregationBuilder.LeafOnly, NestedAggregationBuilder, NestedQueryBuilder, PercentileRanksAggregationBuilder, PercentilesAggregationBuilder, PercentilesBucketPipelineAggregationBuilder, PipelineAggregationBuilder, PrefixQueryBuilder, QueryRescorerBuilder, QueryStringQueryBuilder, RangeAggregationBuilder, RangeQueryBuilder, RareTermsAggregationBuilder, RegexpQueryBuilder, RescorerBuilder, ReverseNestedAggregationBuilder, SamplerAggregationBuilder, ScoreSortBuilder, ScriptedMetricAggregationBuilder, ScriptQueryBuilder, ScriptScoreQueryBuilder, ScriptSortBuilder, SearchRequest, SearchSourceBuilder, SerialDiffPipelineAggregationBuilder, SignificantTermsAggregationBuilder, SignificantTextAggregationBuilder, SimpleQueryStringBuilder, SortBuilder, SpanContainingQueryBuilder, SpanFirstQueryBuilder, SpanMultiTermQueryBuilder, SpanNearQueryBuilder, SpanNearQueryBuilder.SpanGapQueryBuilder, SpanNotQueryBuilder, SpanOrQueryBuilder, SpanTermQueryBuilder, SpanWithinQueryBuilder, StatsAggregationBuilder, StatsBucketPipelineAggregationBuilder, SumAggregationBuilder, SumBucketPipelineAggregationBuilder, TermQueryBuilder, TermsAggregationBuilder, TermsQueryBuilder, TermsSetQueryBuilder, TopHitsAggregationBuilder, TypeQueryBuilder, ValueCountAggregationBuilder, ValuesSourceAggregationBuilder, ValuesSourceAggregationBuilder.LeafOnly, VariableWidthHistogramAggregationBuilder, WeightedAvgAggregationBuilder, WildcardQueryBuilder, WrapperQueryBuilder

public interface Rewriteable<T>
A basic interface for rewriteable classes.
  • Field Details

  • Method Details

    • rewrite

      T rewrite(QueryRewriteContext ctx) throws IOException
      Rewrites this instance based on the provided context. The returned objects will be the same instance as this if no changes during the rewrite were applied.
      Throws:
      IOException
    • rewrite

      static <T extends Rewriteable<T>> T rewrite(T original, QueryRewriteContext context) throws IOException
      Rewrites the given Rewriteable into its primitive form. Rewriteables that for instance fetch resources from remote hosts or can simplify / optimize itself should do their heavy lifting during rewrite(QueryRewriteContext). This method rewrites the rewriteable until it doesn't change anymore.
      Parameters:
      original - the original rewriteable to rewrite
      context - the rewrite context to use
      Throws:
      IOException - if an IOException occurs
    • rewrite

      static <T extends Rewriteable<T>> T rewrite(T original, QueryRewriteContext context, boolean assertNoAsyncTasks) throws IOException
      Rewrites the given Rewriteable into its primitive form. Rewriteables that for instance fetch resources from remote hosts or can simplify / optimize itself should do their heavy lifting during rewriteAndFetch(Rewriteable, QueryRewriteContext, ActionListener) (QueryRewriteContext)}. This method rewrites the rewriteable until it doesn't change anymore.
      Parameters:
      original - the original rewriteable to rewrite
      context - the rewrite context to use
      assertNoAsyncTasks - if true the rewrite will fail if there are any pending async tasks on the context after the rewrite. See QueryRewriteContext.executeAsyncActions(ActionListener) for details
      Throws:
      IOException - if an IOException occurs
    • rewriteAndFetch

      static <T extends Rewriteable<T>> void rewriteAndFetch(T original, QueryRewriteContext context, ActionListener<T> rewriteResponse)
      Rewrites the given rewriteable and fetches pending async tasks for each round before rewriting again.
    • rewriteAndFetch

      static <T extends Rewriteable<T>> void rewriteAndFetch(T original, QueryRewriteContext context, ActionListener<T> rewriteResponse, int iteration)
      Rewrites the given rewriteable and fetches pending async tasks for each round before rewriting again.
    • rewrite

      static <T extends Rewriteable<T>> List<T> rewrite(List<T> rewritables, QueryRewriteContext context) throws IOException
      Rewrites each element of the list until it doesn't change and returns a new list iff there is at least one element of the list that changed during it's rewrite. Otherwise the given list instance is returned unchanged.
      Throws:
      IOException