Interface ExtendedQuery

All Known Subinterfaces:
PostFilter
All Known Implementing Classes:
AbstractReRankQuery, AnalyticsQuery, CollapsingQParserPlugin.CollapsingPostFilter, ExportQParserPlugin.ExportQuery, ExtendedQueryBase, FilterQuery, FunctionRangeQuery, RankQuery, SolrRangeQuery, WrappedQuery

public interface ExtendedQuery
The ExtendedQuery interface provides extra metadata to a query. Implementations of ExtendedQuery must also extend Query.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Should this query be cached in the query cache or filter cache.
    int
    Returns the cost of this query, used to order checking of filters that are not cached.
    default org.apache.lucene.search.Query
    Returns this Query, applying QueryUtils.makeQueryable(Query) and maybe wrapping it to apply the getCost() if it's above zero.
    void
    setCache(boolean cache)
     
    void
    setCost(int cost)
     
  • Method Details

    • getCache

      boolean getCache()
      Should this query be cached in the query cache or filter cache.
    • setCache

      void setCache(boolean cache)
    • getCost

      int getCost()
      Returns the cost of this query, used to order checking of filters that are not cached. If getCache()==false && getCost()>=100 && this instanceof PostFilter, then the PostFilter interface will be used for filtering. Otherwise, for smaller costs, this cost will be used for TwoPhaseIterator.matchCost().
    • setCost

      void setCost(int cost)
    • getCostAppliedQuery

      default org.apache.lucene.search.Query getCostAppliedQuery()
      Returns this Query, applying QueryUtils.makeQueryable(Query) and maybe wrapping it to apply the getCost() if it's above zero. Subclasses may customize this if the query internally applies the configurable cost on the underlying TwoPhaseIterator.matchCost().