public final class QueryTermExtractor extends Object
| Constructor and Description |
|---|
QueryTermExtractor() |
| Modifier and Type | Method and Description |
|---|---|
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
|
public static final WeightedTerm[] getTerms(Query query)
query - Query to extract term texts frompublic 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 changing intensity of font colorfieldName - the field on which Inverse Document Frequency (IDF) calculations are basedpublic 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 termspublic static final WeightedTerm[] getTerms(Query query, boolean prohibited)
query - Query to extract term texts fromprohibited - true to extract "prohibited" terms, too