Class SolrConstantScoreQuery

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public class SolrConstantScoreQuery
    implements ExtendedQuery
    A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter. This Solr extension also supports weighting of a SolrFilter. Experimental and subject to change.
    • Constructor Detail

      • SolrConstantScoreQuery

        public SolrConstantScoreQuery​(Filter filter)
    • Method Detail

      • getFilter

        public Filter getFilter()
        Returns the encapsulated filter
      • getCache

        public boolean getCache()
        Description copied from interface: ExtendedQuery
        Should this query be cached in the query cache or filter cache.
        Specified by:
        getCache in interface ExtendedQuery
      • getCacheSep

        public boolean getCacheSep()
        Description copied from interface: ExtendedQuery
        If true, the clauses of this boolean query should be cached separately. This is not yet implemented.
        Specified by:
        getCacheSep in interface ExtendedQuery
      • getCost

        public int getCost()
        Description copied from interface: ExtendedQuery
        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.
        Specified by:
        getCost in interface ExtendedQuery
      • createWeight

        public createWeight​( searcher,
                                                            boolean needsScores,
                                                            float boost)
                                                     throws IOException
        createWeight in class
      • toString

        public String toString​(String field)
        Prints a user-readable version of this query.
        Specified by:
        toString in class
      • equals

        public boolean equals​(Object other)
        Returns true if o is equal to this.
        Specified by:
        equals in class
      • hashCode

        public int hashCode()
        Returns a hash code value for this object.
        Specified by:
        hashCode in class