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

All Implemented Interfaces:
    Scorer

Scorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.
Field Summary
 TextFragment currentTextFragment     
 HashSet<String> uniqueTermsInFragment     
 float totalScore     
 float maxTermWeight     
Constructor:
 public QueryTermScorer(Query query) 
    Parameters:
    query - a Lucene query (ideally rewritten using query.rewrite before being passed to this class and the searcher)
 public QueryTermScorer(WeightedTerm[] weightedTerms) 
 public QueryTermScorer(Query query,
    String fieldName) 
    Parameters:
    query - a Lucene query (ideally rewritten using query.rewrite before being passed to this class and the searcher)
    fieldName - the Field name which is used to match Query terms
 public QueryTermScorer(Query query,
    IndexReader reader,
    String fieldName) 
    Parameters:
    query - a Lucene query (ideally rewritten using query.rewrite before being passed to this class and the searcher)
    reader - used to compute IDF which can be used to a) score selected fragments better b) use graded highlights eg set font color intensity
    fieldName - the field on which Inverse Document Frequency (IDF) calculations are based
Method from org.apache.lucene.search.highlight.QueryTermScorer Summary:
allFragmentsProcessed,   getFragmentScore,   getMaxTermWeight,   getTokenScore,   init,   startFragment
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.search.highlight.QueryTermScorer Detail:
 public  void allFragmentsProcessed() 
 public float getFragmentScore() 
 public float getMaxTermWeight() 
 public float getTokenScore() 
 public TokenStream init(TokenStream tokenStream) 
 public  void startFragment(TextFragment newFragment)