|
DLESE Tools v1.6.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.lucene.queryParser.QueryParser
org.dlese.dpc.index.queryParser.FieldExpansionQueryParser
public class FieldExpansionQueryParser
A QueryParser that modifies a user's query by expanding the fields that are searched, applying boosting, and applying Query mappings for the given virtual field/terms. The static parse method must be used - see it's definition for details.
VirtualSearchFieldMapper| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.lucene.queryParser.QueryParser |
|---|
QueryParser.Operator |
| Field Summary |
|---|
| Fields inherited from class org.apache.lucene.queryParser.QueryParser |
|---|
AND_OPERATOR, jj_nt, OR_OPERATOR, token, token_source |
| Fields inherited from interface org.apache.lucene.queryParser.QueryParserConstants |
|---|
_ESCAPED_CHAR, _NUM_CHAR, _QUOTED_CHAR, _TERM_CHAR, _TERM_START_CHAR, _WHITESPACE, AND, Boost, CARAT, COLON, DEFAULT, EOF, FUZZY_SLOP, LPAREN, MINUS, NOT, NUMBER, OR, PLUS, PREFIXTERM, QUOTED, RangeEx, RANGEEX_END, RANGEEX_GOOP, RANGEEX_QUOTED, RANGEEX_START, RANGEEX_TO, RangeIn, RANGEIN_END, RANGEIN_GOOP, RANGEIN_QUOTED, RANGEIN_START, RANGEIN_TO, RPAREN, STAR, TERM, tokenImage, WILDTERM |
| Method Summary | |
|---|---|
protected Query |
getFieldQuery(String field,
String queryText)
Gets the fieldQuery attribute of the FieldExpansionQueryParser object |
Query |
parse(String query)
Parses a query which searches on the fields specified. |
static Query |
parse(String query,
Analyzer analyzer,
String[] expansionFields,
String[] boostingFields,
Map boostValues,
VirtualSearchFieldMapper mappedFields,
QueryParser.Operator defaultOperator)
Parses the query text to create an expanded Lucene Query. |
Query |
parse(String query,
String field)
Parses a query string, returning a Query. |
static void |
setDebug(boolean db)
Sets the debug attribute of the FieldQueryParser object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Query parse(String query,
Analyzer analyzer,
String[] expansionFields,
String[] boostingFields,
Map boostValues,
VirtualSearchFieldMapper mappedFields,
QueryParser.Operator defaultOperator)
throws ParseException
If n fields are specified, this effectively constructs:
(field1:query) (field2:query) (field3:query)...(fieldn:query)
query - The query textanalyzer - The Analyzer to userexpansionFields - Fields to search in for default text, which must contain at least one fieldboostingFields - Fields to boost terms found in the default text, or nullboostValues - A Map of boosting values corresponding the the boostingFields - Map of
String/Float pairs, or nullmappedFields - Field/term mappings to apply, or nulldefaultOperator - Default AND or OR operator
ParseException - If unable to parse the query
public Query parse(String query)
throws ParseException
If n fields are specified, this effectively constructs:
(field1:query) (field2:query) (field3:query)...(fieldn:query)
parse in class QueryParserquery - Query string to parse
ParseException - if query parsing fails
TokenMgrError - if query parsing fails
public Query parse(String query,
String field)
throws ParseException
query - the query string to be parsed.field - the default field for this query.
ParseException - if the parsing fails
protected Query getFieldQuery(String field,
String queryText)
throws ParseException
getFieldQuery in class QueryParserfield - The field being processedqueryText - The text in the field
ParseException - If errorpublic static void setDebug(boolean db)
db - The new debug value
|
DLESE Tools v1.6.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||