com.atlassian.jira.util.lucene
Class ConstantScorePrefixQuery

java.lang.Object
  extended by org.apache.lucene.search.Query
      extended by org.apache.lucene.search.MultiTermQuery
          extended by org.apache.lucene.search.PrefixQuery
              extended by 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 Class Summary
 
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
 
Field Summary
 
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
 
Constructor Summary
ConstantScorePrefixQuery(org.apache.lucene.index.Term term)
           
 
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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstantScorePrefixQuery

public ConstantScorePrefixQuery(org.apache.lucene.index.Term term)
Method Detail

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-2012 Atlassian. All Rights Reserved.