|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.search.highlight.QueryTermExtractor
public final class QueryTermExtractor
Utility class used to extract the terms used in a query, plus any weights. This class will not find terms for MultiTermQuery, RangeQuery and PrefixQuery classes so the caller must pass a rewritten query (see Query.rewrite) to obtain a list of expanded terms.
| Constructor Summary | |
|---|---|
QueryTermExtractor()
|
|
| Method Summary | |
|---|---|
static WeightedTerm[] |
getIdfWeightedTerms(Query query,
IndexReader reader,
String fieldName)
Extracts all terms texts of a given Query into an array of WeightedTerms |
static WeightedTerm[] |
getTerms(Query query)
Extracts all terms texts of a given Query into an array of WeightedTerms |
static WeightedTerm[] |
getTerms(Query query,
boolean prohibited)
Extracts all terms texts of a given Query into an array of WeightedTerms |
static WeightedTerm[] |
getTerms(Query query,
boolean prohibited,
String fieldName)
Extracts all terms texts of a given Query into an array of WeightedTerms |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueryTermExtractor()
| Method Detail |
|---|
public static final WeightedTerm[] getTerms(Query query)
query - Query to extract term texts from
public static final WeightedTerm[] getIdfWeightedTerms(Query query,
IndexReader reader,
String fieldName)
query - Query to extract term texts fromreader - used to compute IDF which can be used to a) score selected fragments better
b) use graded highlights eg chaning intensity of font colorfieldName - the field on which Inverse Document Frequency (IDF) calculations are based
public static final WeightedTerm[] getTerms(Query query,
boolean prohibited,
String fieldName)
query - Query to extract term texts fromprohibited - true to extract "prohibited" terms, toofieldName - The fieldName used to filter query terms
public static final WeightedTerm[] getTerms(Query query,
boolean prohibited)
query - Query to extract term texts fromprohibited - true to extract "prohibited" terms, too
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||