public class JackrabbitQueryParser
extends org.apache.lucene.queryParser.QueryParser
JackrabbitQueryParser
extends the standard lucene query parser
and adds JCR specific customizations.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
Constructor and Description |
---|
JackrabbitQueryParser(String fieldName,
org.apache.lucene.analysis.Analyzer analyzer,
SynonymProvider synonymProvider,
org.apache.jackrabbit.core.query.lucene.PerQueryCache cache)
Creates a new query parser instance.
|
Modifier and Type | Method and Description |
---|---|
protected org.apache.lucene.search.Query |
getFieldQuery(String field,
String queryText) |
protected org.apache.lucene.search.Query |
getFieldQuery(String field,
String queryText,
boolean quoted) |
protected org.apache.lucene.search.Query |
getPrefixQuery(String field,
String termStr) |
protected org.apache.lucene.search.Query |
getSynonymQuery(String field,
String termStr)
Factory method for generating a synonym query.
|
protected org.apache.lucene.search.Query |
getWildcardQuery(String field,
String termStr) |
org.apache.lucene.search.Query |
parse(String textsearch) |
addClause, Clause, Conjunction, disable_tracing, enable_tracing, escape, generateParseException, getAllowLeadingWildcard, getAnalyzer, getAutoGeneratePhraseQueries, getBooleanQuery, getBooleanQuery, getDateResolution, getDefaultOperator, getEnablePositionIncrements, getField, getFieldQuery, getFuzzyMinSim, getFuzzyPrefixLength, getFuzzyQuery, getLocale, getLowercaseExpandedTerms, getMultiTermRewriteMethod, getNextToken, getPhraseSlop, getRangeCollator, getRangeQuery, getToken, main, Modifiers, newBooleanClause, newBooleanQuery, newFuzzyQuery, newMatchAllDocsQuery, newMultiPhraseQuery, newPhraseQuery, newPrefixQuery, newRangeQuery, newTermQuery, newWildcardQuery, Query, ReInit, ReInit, setAllowLeadingWildcard, setAutoGeneratePhraseQueries, setDateResolution, setDateResolution, setDefaultOperator, setEnablePositionIncrements, setFuzzyMinSim, setFuzzyPrefixLength, setLocale, setLowercaseExpandedTerms, setMultiTermRewriteMethod, setPhraseSlop, setRangeCollator, Term, TopLevelQuery
public JackrabbitQueryParser(String fieldName, org.apache.lucene.analysis.Analyzer analyzer, SynonymProvider synonymProvider, org.apache.jackrabbit.core.query.lucene.PerQueryCache cache)
fieldName
- the field name.analyzer
- the analyzer.synonymProvider
- the synonym provider or null
if none
is available.public org.apache.lucene.search.Query parse(String textsearch) throws org.apache.lucene.queryParser.ParseException
parse
in class org.apache.lucene.queryParser.QueryParser
org.apache.lucene.queryParser.ParseException
protected org.apache.lucene.search.Query getSynonymQuery(String field, String termStr) throws org.apache.lucene.queryParser.ParseException
field
- Name of the field query will use.termStr
- Term token to use for building term for the queryQuery
built for the termorg.apache.lucene.queryParser.ParseException
- throw in overridden method to disallowprotected org.apache.lucene.search.Query getFieldQuery(String field, String queryText) throws org.apache.lucene.queryParser.ParseException
getFieldQuery
in class org.apache.lucene.queryParser.QueryParser
org.apache.lucene.queryParser.ParseException
protected org.apache.lucene.search.Query getFieldQuery(String field, String queryText, boolean quoted) throws org.apache.lucene.queryParser.ParseException
getFieldQuery
in class org.apache.lucene.queryParser.QueryParser
org.apache.lucene.queryParser.ParseException
protected org.apache.lucene.search.Query getPrefixQuery(String field, String termStr) throws org.apache.lucene.queryParser.ParseException
getPrefixQuery
in class org.apache.lucene.queryParser.QueryParser
org.apache.lucene.queryParser.ParseException
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.