public static class

MultiTermQuery.ConstantScoreAutoRewrite

extends MultiTermQuery.RewriteMethod
implements Serializable
java.lang.Object
   ↳ org.apache.lucene.search.MultiTermQuery.RewriteMethod
     ↳ org.apache.lucene.search.MultiTermQuery.ConstantScoreAutoRewrite

Class Overview

A rewrite method that tries to pick the best constant-score rewrite method based on term and document counts from the query. If both the number of terms and documents is small enough, then CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE is used. Otherwise, CONSTANT_SCORE_FILTER_REWRITE is used.

Summary

Fields
public static double DEFAULT_DOC_COUNT_PERCENT
public static int DEFAULT_TERM_COUNT_CUTOFF
Public Constructors
MultiTermQuery.ConstantScoreAutoRewrite()
Public Methods
boolean equals(Object obj)
double getDocCountPercent()
int getTermCountCutoff()
int hashCode()
Query rewrite(IndexReader reader, MultiTermQuery query)
void setDocCountPercent(double percent)
If the number of documents to be visited in the postings exceeds this specified percentage of the maxDoc() for the index, then CONSTANT_SCORE_FILTER_REWRITE is used.
void setTermCountCutoff(int count)
If the number of terms in this query is equal to or larger than this setting then CONSTANT_SCORE_FILTER_REWRITE is used.
[Expand]
Inherited Methods
From class org.apache.lucene.search.MultiTermQuery.RewriteMethod
From class java.lang.Object

Fields

public static double DEFAULT_DOC_COUNT_PERCENT

public static int DEFAULT_TERM_COUNT_CUTOFF

Public Constructors

public MultiTermQuery.ConstantScoreAutoRewrite ()

Public Methods

public boolean equals (Object obj)

public double getDocCountPercent ()

public int getTermCountCutoff ()

public int hashCode ()

public Query rewrite (IndexReader reader, MultiTermQuery query)

Throws
IOException

public void setDocCountPercent (double percent)

If the number of documents to be visited in the postings exceeds this specified percentage of the maxDoc() for the index, then CONSTANT_SCORE_FILTER_REWRITE is used.

Parameters
percent 0.0 to 100.0

public void setTermCountCutoff (int count)

If the number of terms in this query is equal to or larger than this setting then CONSTANT_SCORE_FILTER_REWRITE is used.