org.apache.lucene.search.highlight
Class QueryScorer
- 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.
QueryScorer
public QueryScorer(Query query)
query
- a Lucene query (ideally rewritten using query.rewrite
before being passed to this class and the searcher)
QueryScorer
public QueryScorer(Query query,
String fieldName)
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
QueryScorer
public QueryScorer(Query query,
IndexReader reader,
String fieldName)
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 intensityfieldName
- the field on which Inverse Document Frequency (IDF) calculations are based
allFragmentsProcessed
public void allFragmentsProcessed()
getMaxTermWeight
public float getMaxTermWeight()
- The highest weighted term (useful for passing to GradientFormatter to set
top end of coloring scale.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.