Class AutoPrefilteringUtils

java.lang.Object
org.elasticsearch.index.query.support.AutoPrefilteringUtils

public final class AutoPrefilteringUtils extends Object
  • Method Details

    • pruneQuery

      public static Optional<QueryBuilder> pruneQuery(QueryBuilder query, Set<Class<? extends QueryBuilder>> prunedTypes)
      Prunes any query branch on queries whose type is included in the prunedTypes set. Note that queries may not preserve their scoring parameters as this assumes the returned query is going to be used for filtering only.
      Parameters:
      query - the root query to start pruning from
      prunedTypes - the types of queries to prune
      Returns:
      an Optional containing the pruned query, or Optional.empty() if the query was pruned to nothing.