Save This Page
Home » lucene-3.0.1-src » org.apache » lucene » search » highlight » [javadoc | source]
org.apache.lucene.search.highlight
public class: QueryScorer [javadoc | source]
java.lang.Object
   org.apache.lucene.search.highlight.QueryScorer

All Implemented Interfaces:
    Scorer

Scorer implementation which scores text fragments by the number of unique query terms found. This class converts appropriate Query s to SpanQuery s and attempts to score only those terms that participated in generating the 'hit' on the document.
Constructor:
 public QueryScorer(Query query) 
    Parameters:
    query - Query to use for highlighting
 public QueryScorer(WeightedSpanTerm[] weightedTerms) 
 public QueryScorer(Query query,
    String field) 
    Parameters:
    query - Query to use for highlighting
    field - Field to highlight - pass null to ignore fields
 public QueryScorer(Query query,
    IndexReader reader,
    String field) 
    Parameters:
    query - Query to use for highlighting
    field - Field to highlight - pass null to ignore fields
    reader - IndexReader to use for quasi tf/idf scoring
 public QueryScorer(Query query,
    String field,
    String defaultField) 
    Parameters:
    defaultField - - The default field for queries with the field name unspecified
 public QueryScorer(Query query,
    IndexReader reader,
    String field,
    String defaultField) 
    Parameters:
    query - to use for highlighting
    reader - IndexReader to use for quasi tf/idf scoring
    field - to highlight - pass null to ignore fields
    defaultField -
Method from org.apache.lucene.search.highlight.QueryScorer Summary:
getFragmentScore,   getMaxTermWeight,   getTokenScore,   getWeightedSpanTerm,   init,   isExpandMultiTermQuery,   setExpandMultiTermQuery,   setWrapIfNotCachingTokenFilter,   startFragment
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.search.highlight.QueryScorer Detail:
 public float getFragmentScore() 
 public float getMaxTermWeight() 
 public float getTokenScore() 
 public WeightedSpanTerm getWeightedSpanTerm(String token) 
 public TokenStream init(TokenStream tokenStream) throws IOException 
 public boolean isExpandMultiTermQuery() 
 public  void setExpandMultiTermQuery(boolean expandMultiTermQuery) 
 public  void setWrapIfNotCachingTokenFilter(boolean wrap) 
 public  void startFragment(TextFragment newFragment)