SolrConstantScoreQuery (Solr 3.6.2 API)
Keywords: org.apache.solr.search.SolrConstantScoreQuery class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.search
Class SolrConstantScoreQuery

    java.lang.Object
      org.apache.lucene.search.Query
          org.apache.lucene.search.ConstantScoreQuery
              org.apache.solr.search.SolrConstantScoreQuery

All Implemented Interfaces:
  Serializable, Cloneable, ExtendedQuery

    public class SolrConstantScoreQuery

extends ConstantScoreQuery
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.

See Also:
  Serialized Form

Nested Class Summary
`protected class` | `SolrConstantScoreQuery.ConstantScorer`
`protected class` | `SolrConstantScoreQuery.ConstantWeight`

Field Summary

Fields inherited from class org.apache.lucene.search.ConstantScoreQuery
`filter, query`

Constructor Summary
`SolrConstantScoreQuery(Filter filter)`

Method Summary
`Weight` | `createWeight(Searcher searcher)`
`boolean` | `equals(Object o)` Returns true if `o` is equal to this.
`void` | `extractTerms(Set terms)`
`boolean` | `getCache()` Should this query be cached in the query cache or filter cache.
`boolean` | `getCacheSep()` If true, the clauses of this boolean query should be cached separately.
`int` | `getCost()` Returns the cost of this query, used to order checking of filters that are not cached.
`Filter` | `getFilter()` Returns the encapsulated filter
`int` | `hashCode()` Returns a hash code value for this object.
`Query` | `rewrite(IndexReader reader)`
`void` | `setCache(boolean cache)`
`void` | `setCacheSep(boolean cacheSep)`
`void` | `setCost(int cost)`
`String` | `toString(String field)` Prints a user-readable version of this query.

Methods inherited from class org.apache.lucene.search.ConstantScoreQuery
`getQuery`

Methods inherited from class org.apache.lucene.search.Query
`clone, combine, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SolrConstantScoreQuery

    public SolrConstantScoreQuery(Filter filter)

Method Detail

### getFilter

    public Filter getFilter()

  Returns the encapsulated filter

  Overrides:
    `getFilter` in class `ConstantScoreQuery`

### setCache

    public void setCache(boolean cache)

  Specified by:
    `setCache` in interface `ExtendedQuery`

### 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`

### setCacheSep

    public void setCacheSep(boolean cacheSep)

  Specified by:
    `setCacheSep` 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`

### setCost

    public void setCost(int cost)

  Specified by:
    `setCost` 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`

### rewrite

    public Query rewrite(IndexReader reader)
                  throws IOException

  Overrides:
    `rewrite` in class `ConstantScoreQuery`
  Throws:
    `IOException`

### extractTerms

    public void extractTerms(Set terms)

  Overrides:
    `extractTerms` in class `ConstantScoreQuery`

### createWeight

    public Weight createWeight(Searcher searcher)

  Overrides:
    `createWeight` in class `ConstantScoreQuery`

### toString

    public String toString(String field)

  Prints a user-readable version of this query.

  Overrides:
    `toString` in class `ConstantScoreQuery`

### equals

    public boolean equals(Object o)

  Returns true if `o` is equal to this.

  Overrides:
    `equals` in class `ConstantScoreQuery`

### hashCode

    public int hashCode()

  Returns a hash code value for this object.

  Overrides:
    `hashCode` in class `ConstantScoreQuery`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD