|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.search.highlight.QueryScorer
public class QueryScorer
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.
Constructor Summary | |
---|---|
QueryScorer(Query query)
|
|
QueryScorer(Query query,
IndexReader reader,
String fieldName)
|
|
QueryScorer(Query query,
String fieldName)
|
|
QueryScorer(WeightedTerm[] weightedTerms)
|
Method Summary | |
---|---|
void |
allFragmentsProcessed()
|
float |
getFragmentScore()
Called when the highlighter has no more tokens for the current fragment - the scorer returns the weighting it has derived for the most recent fragment, typically based on the tokens passed to getTokenScore(). |
float |
getMaxTermWeight()
|
float |
getTokenScore(Token token)
Called for each token in the current fragment |
void |
startFragment(TextFragment newFragment)
called when a new fragment is started for consideration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueryScorer(Query query)
query
- a Lucene query (ideally rewritten using query.rewrite
before being passed to this class and the searcher)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 termspublic 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 basedpublic QueryScorer(WeightedTerm[] weightedTerms)
Method Detail |
---|
public void startFragment(TextFragment newFragment)
Scorer
startFragment
in interface Scorer
public float getTokenScore(Token token)
Scorer
getTokenScore
in interface Scorer
token
- The token to be scored
public float getFragmentScore()
Scorer
getFragmentScore
in interface Scorer
public void allFragmentsProcessed()
public float getMaxTermWeight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |