public class FieldExpansionQueryParser
extends org.apache.lucene.queryParser.QueryParser
VirtualSearchFieldMapper
AND_OPERATOR, jj_nt, OR_OPERATOR, token, token_source
_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
Modifier and Type | Method and Description |
---|---|
protected org.apache.lucene.search.Query |
getFieldQuery(java.lang.String field,
java.lang.String queryText)
Gets the fieldQuery attribute of the FieldExpansionQueryParser object
|
org.apache.lucene.search.Query |
parse(java.lang.String query)
Parses a query which searches on the fields specified.
|
static org.apache.lucene.search.Query |
parse(java.lang.String query,
org.apache.lucene.analysis.Analyzer analyzer,
java.lang.String[] expansionFields,
java.lang.String[] boostingFields,
java.util.Map boostValues,
VirtualSearchFieldMapper mappedFields,
org.apache.lucene.queryParser.QueryParser.Operator defaultOperator)
Parses the query text to create an expanded Lucene Query.
|
org.apache.lucene.search.Query |
parse(java.lang.String query,
java.lang.String field)
Parses a query string, returning a Query.
|
static void |
setDebug(boolean db)
Sets the debug attribute of the FieldQueryParser object
|
addClause, Clause, Conjunction, disable_tracing, enable_tracing, escape, generateParseException, getAllowLeadingWildcard, getAnalyzer, getBooleanQuery, getBooleanQuery, getDateResolution, getDefaultOperator, getEnablePositionIncrements, getField, getFieldQuery, getFuzzyMinSim, getFuzzyPrefixLength, getFuzzyQuery, getLocale, getLowercaseExpandedTerms, getMultiTermRewriteMethod, getNextToken, getPhraseSlop, getPrefixQuery, getRangeCollator, getRangeQuery, getToken, getWildcardQuery, main, Modifiers, newBooleanClause, newBooleanQuery, newFuzzyQuery, newMatchAllDocsQuery, newMultiPhraseQuery, newPhraseQuery, newPrefixQuery, newRangeQuery, newTermQuery, newWildcardQuery, Query, ReInit, ReInit, setAllowLeadingWildcard, setDateResolution, setDateResolution, setDefaultOperator, setEnablePositionIncrements, setFuzzyMinSim, setFuzzyPrefixLength, setLocale, setLowercaseExpandedTerms, setMultiTermRewriteMethod, setPhraseSlop, setRangeCollator, Term, TopLevelQuery
public static org.apache.lucene.search.Query parse(java.lang.String query, org.apache.lucene.analysis.Analyzer analyzer, java.lang.String[] expansionFields, java.lang.String[] boostingFields, java.util.Map boostValues, VirtualSearchFieldMapper mappedFields, org.apache.lucene.queryParser.QueryParser.Operator defaultOperator) throws org.apache.lucene.queryParser.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 operatororg.apache.lucene.queryParser.ParseException
- If unable to parse the querypublic org.apache.lucene.search.Query parse(java.lang.String query) throws org.apache.lucene.queryParser.ParseException
If n fields are specified, this effectively constructs:
(field1:query) (field2:query) (field3:query)...(fieldn:query)
parse
in class org.apache.lucene.queryParser.QueryParser
query
- Query string to parseorg.apache.lucene.queryParser.ParseException
- if query parsing failsorg.apache.lucene.queryParser.TokenMgrError
- if query parsing failspublic org.apache.lucene.search.Query parse(java.lang.String query, java.lang.String field) throws org.apache.lucene.queryParser.ParseException
query
- the query string to be parsed.field
- the default field for this query.org.apache.lucene.queryParser.ParseException
- if the parsing failsprotected org.apache.lucene.search.Query getFieldQuery(java.lang.String field, java.lang.String queryText) throws org.apache.lucene.queryParser.ParseException
getFieldQuery
in class org.apache.lucene.queryParser.QueryParser
field
- The field being processedqueryText
- The text in the fieldorg.apache.lucene.queryParser.ParseException
- If errorpublic static void setDebug(boolean db)
db
- The new debug value