com.atlassian.jira.util.lucene
Class ConstantScorePrefixQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.MultiTermQuery
org.apache.lucene.search.PrefixQuery
com.atlassian.jira.util.lucene.ConstantScorePrefixQuery
- All Implemented Interfaces:
- Serializable, Cloneable
public class ConstantScorePrefixQuery
- extends org.apache.lucene.search.PrefixQuery
PrefixQuery that doesn't rewrite into a BooleanQuery
with all matching
terms
in the field. This query returns a constant score equal
to its boost for all documents with the matching prefix term.
This can be significantly cheaper and faster if there are a lot of matching terms.
It is very slightly slower if the number of matched terms is one or two.
- Since:
- 4.0
- See Also:
http://jira.atlassian.com/browse/JRA-17623
,
Serialized Form
Nested classes/interfaces inherited from class org.apache.lucene.search.MultiTermQuery |
org.apache.lucene.search.MultiTermQuery.ConstantScoreAutoRewrite, org.apache.lucene.search.MultiTermQuery.RewriteMethod, org.apache.lucene.search.MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, org.apache.lucene.search.MultiTermQuery.TopTermsScoringBooleanQueryRewrite |
Fields inherited from class org.apache.lucene.search.MultiTermQuery |
CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, rewriteMethod, SCORING_BOOLEAN_QUERY_REWRITE |
Method Summary |
org.apache.lucene.search.Query |
rewrite(org.apache.lucene.index.IndexReader reader)
|
Methods inherited from class org.apache.lucene.search.PrefixQuery |
equals, getEnum, getPrefix, hashCode, toString |
Methods inherited from class org.apache.lucene.search.MultiTermQuery |
clearTotalNumberOfTerms, getRewriteMethod, getTotalNumberOfTerms, incTotalNumberOfTerms, setRewriteMethod |
Methods inherited from class org.apache.lucene.search.Query |
clone, combine, createWeight, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight |
ConstantScorePrefixQuery
public ConstantScorePrefixQuery(org.apache.lucene.index.Term term)
rewrite
public org.apache.lucene.search.Query rewrite(org.apache.lucene.index.IndexReader reader)
throws IOException
- Overrides:
rewrite
in class org.apache.lucene.search.MultiTermQuery
- Throws:
IOException
Copyright © 2002-2013 Atlassian. All Rights Reserved.