Class QueryParserWrapper
- java.lang.Object
-
- org.apache.lucene.queryParser.standard.QueryParserWrapper
-
- Direct Known Subclasses:
MultiFieldQueryParserWrapper
@Deprecated public class QueryParserWrapper extends Object
Deprecated.this class will be removed soon, it's a temporary class to be used along the transition from the old query parser to the new oneThis class performs the query parsing using the new query parser implementation, but keeps the oldQueryParserAPI.
This class should be used when the new query parser features are and the oldQueryParserAPI are needed at the same time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueryParserWrapper.OperatorDeprecated.The default operator for parsing queries.
-
Field Summary
Fields Modifier and Type Field Description static QueryParserWrapper.OperatorAND_OPERATORDeprecated.Alternative form of QueryParser.Operator.ANDstatic QueryParserWrapper.OperatorOR_OPERATORDeprecated.Alternative form of QueryParser.Operator.OR
-
Constructor Summary
Constructors Constructor Description QueryParserWrapper(String defaultField, Analyzer analyzer)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Stringescape(String s)Deprecated.Returns a String where those characters that QueryParser expects to be escaped are escaped by a preceding\.ParseExceptiongenerateParseException()Deprecated.booleangetAllowLeadingWildcard()Deprecated.AnalyzergetAnalyzer()Deprecated.protected QuerygetBooleanQuery(List<BooleanClause> clauses, boolean disableCoord)Deprecated.DateTools.ResolutiongetDateResolution(String fieldName)Deprecated.QueryParserWrapper.OperatorgetDefaultOperator()Deprecated.booleangetEnablePositionIncrements()Deprecated.StringgetField()Deprecated.protected QuerygetFieldQuery(String field, String queryText)Deprecated.UsegetFieldQuery(String, String, boolean)insteadprotected QuerygetFieldQuery(String field, String queryText, boolean quoted)Deprecated.protected QuerygetFieldQuery(String field, String queryText, int slop)Deprecated.Base implementation delegates togetFieldQuery(String,String).floatgetFuzzyMinSim()Deprecated.intgetFuzzyPrefixLength()Deprecated.protected QuerygetFuzzyQuery(String field, String termStr, float minSimilarity)Deprecated.LocalegetLocale()Deprecated.booleangetLowercaseExpandedTerms()Deprecated.MultiTermQuery.RewriteMethodgetMultiTermRewriteMethod()Deprecated.intgetPhraseSlop()Deprecated.protected QuerygetPrefixQuery(String field, String termStr)Deprecated.QueryConfigHandlergetQueryConfigHandler()Deprecated.Returns the query config handler used by this query parserQueryNodeProcessorgetQueryProcessor()Deprecated.ReturnsQueryNodeProcessorused to process the query node tree generated by theStandardSyntaxParser.CollatorgetRangeCollator()Deprecated.protected QuerygetRangeQuery(String field, String part1, String part2, boolean inclusive)Deprecated.booleangetUseOldRangeQuery()Deprecated.protected QuerygetWildcardQuery(String field, String termStr)Deprecated.Queryparse(String query)Deprecated.voidsetAllowLeadingWildcard(boolean allowLeadingWildcard)Deprecated.voidsetDateResolution(String fieldName, DateTools.Resolution dateResolution)Deprecated.voidsetDateResolution(DateTools.Resolution dateResolution)Deprecated.voidsetDefaultOperator(QueryParserWrapper.Operator op)Deprecated.voidsetEnablePositionIncrements(boolean enable)Deprecated.voidsetFuzzyMinSim(float fuzzyMinSim)Deprecated.voidsetFuzzyPrefixLength(int fuzzyPrefixLength)Deprecated.voidsetLocale(Locale locale)Deprecated.voidsetLowercaseExpandedTerms(boolean lowercaseExpandedTerms)Deprecated.voidsetMultiTermRewriteMethod(MultiTermQuery.RewriteMethod method)Deprecated.voidsetPhraseSlop(int phraseSlop)Deprecated.voidsetQueryBuilder(StandardQueryBuilder builder)Deprecated.Sets theStandardQueryBuilderused to generate aQueryobject from the parsed and processed query node tree.voidsetQueryConfig(StandardQueryConfigHandler queryConfig)Deprecated.Sets theQueryConfigHandlerused by theQueryNodeProcessorset to this object.voidsetQueryProcessor(QueryNodeProcessor processor)Deprecated.Sets theQueryNodeProcessorused to process the query node tree generated by theStandardSyntaxParser.voidsetRangeCollator(Collator rc)Deprecated.voidsetUseOldRangeQuery(boolean useOldRangeQuery)Deprecated.
-
-
-
Field Detail
-
AND_OPERATOR
public static final QueryParserWrapper.Operator AND_OPERATOR
Deprecated.Alternative form of QueryParser.Operator.AND
-
OR_OPERATOR
public static final QueryParserWrapper.Operator OR_OPERATOR
Deprecated.Alternative form of QueryParser.Operator.OR
-
-
Method Detail
-
escape
public static String escape(String s)
Deprecated.Returns a String where those characters that QueryParser expects to be escaped are escaped by a preceding\.
-
getField
public String getField()
Deprecated.
-
getAnalyzer
public Analyzer getAnalyzer()
Deprecated.
-
setQueryBuilder
public void setQueryBuilder(StandardQueryBuilder builder)
Deprecated.Sets theStandardQueryBuilderused to generate aQueryobject from the parsed and processed query node tree.- Parameters:
builder- the builder
-
setQueryProcessor
public void setQueryProcessor(QueryNodeProcessor processor)
Deprecated.Sets theQueryNodeProcessorused to process the query node tree generated by theStandardSyntaxParser.- Parameters:
processor- the processor
-
setQueryConfig
public void setQueryConfig(StandardQueryConfigHandler queryConfig)
Deprecated.Sets theQueryConfigHandlerused by theQueryNodeProcessorset to this object.- Parameters:
queryConfig- the query config handler
-
getQueryConfigHandler
public QueryConfigHandler getQueryConfigHandler()
Deprecated.Returns the query config handler used by this query parser- Returns:
- the query config handler
-
getQueryProcessor
public QueryNodeProcessor getQueryProcessor()
Deprecated.ReturnsQueryNodeProcessorused to process the query node tree generated by theStandardSyntaxParser.- Returns:
- the query processor
-
generateParseException
public ParseException generateParseException()
Deprecated.
-
getAllowLeadingWildcard
public boolean getAllowLeadingWildcard()
Deprecated.
-
getMultiTermRewriteMethod
public MultiTermQuery.RewriteMethod getMultiTermRewriteMethod()
Deprecated.
-
getDateResolution
public DateTools.Resolution getDateResolution(String fieldName)
Deprecated.
-
getEnablePositionIncrements
public boolean getEnablePositionIncrements()
Deprecated.
-
getFuzzyMinSim
public float getFuzzyMinSim()
Deprecated.
-
getFuzzyPrefixLength
public int getFuzzyPrefixLength()
Deprecated.
-
getLocale
public Locale getLocale()
Deprecated.
-
getLowercaseExpandedTerms
public boolean getLowercaseExpandedTerms()
Deprecated.
-
getPhraseSlop
public int getPhraseSlop()
Deprecated.
-
getRangeCollator
public Collator getRangeCollator()
Deprecated.
-
getUseOldRangeQuery
public boolean getUseOldRangeQuery()
Deprecated.
-
parse
public Query parse(String query) throws ParseException
Deprecated.- Throws:
ParseException
-
setAllowLeadingWildcard
public void setAllowLeadingWildcard(boolean allowLeadingWildcard)
Deprecated.
-
setMultiTermRewriteMethod
public void setMultiTermRewriteMethod(MultiTermQuery.RewriteMethod method)
Deprecated.
-
setDateResolution
public void setDateResolution(DateTools.Resolution dateResolution)
Deprecated.
-
setDateResolution
public void setDateResolution(String fieldName, DateTools.Resolution dateResolution)
Deprecated.
-
setDefaultOperator
public void setDefaultOperator(QueryParserWrapper.Operator op)
Deprecated.
-
getDefaultOperator
public QueryParserWrapper.Operator getDefaultOperator()
Deprecated.
-
setEnablePositionIncrements
public void setEnablePositionIncrements(boolean enable)
Deprecated.
-
setFuzzyMinSim
public void setFuzzyMinSim(float fuzzyMinSim)
Deprecated.
-
setFuzzyPrefixLength
public void setFuzzyPrefixLength(int fuzzyPrefixLength)
Deprecated.
-
setLocale
public void setLocale(Locale locale)
Deprecated.
-
setLowercaseExpandedTerms
public void setLowercaseExpandedTerms(boolean lowercaseExpandedTerms)
Deprecated.
-
setPhraseSlop
public void setPhraseSlop(int phraseSlop)
Deprecated.
-
setRangeCollator
public void setRangeCollator(Collator rc)
Deprecated.
-
setUseOldRangeQuery
public void setUseOldRangeQuery(boolean useOldRangeQuery)
Deprecated.
-
getPrefixQuery
protected Query getPrefixQuery(String field, String termStr) throws ParseException
Deprecated.- Throws:
ParseException
-
getWildcardQuery
protected Query getWildcardQuery(String field, String termStr) throws ParseException
Deprecated.- Throws:
ParseException
-
getFuzzyQuery
protected Query getFuzzyQuery(String field, String termStr, float minSimilarity) throws ParseException
Deprecated.- Throws:
ParseException
-
getFieldQuery
@Deprecated protected Query getFieldQuery(String field, String queryText) throws ParseException
Deprecated.UsegetFieldQuery(String, String, boolean)instead- Throws:
ParseException
-
getFieldQuery
protected Query getFieldQuery(String field, String queryText, boolean quoted) throws ParseException
Deprecated.- Throws:
ParseException- throw in overridden method to disallow
-
getBooleanQuery
protected Query getBooleanQuery(List<BooleanClause> clauses, boolean disableCoord) throws ParseException
Deprecated.- Throws:
ParseException
-
getFieldQuery
protected Query getFieldQuery(String field, String queryText, int slop) throws ParseException
Deprecated.Base implementation delegates togetFieldQuery(String,String). This method may be overridden, for example, to return a SpanNearQuery instead of a PhraseQuery.- Throws:
ParseException- throw in overridden method to disallow
-
getRangeQuery
protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException
Deprecated.- Throws:
ParseException- throw in overridden method to disallow
-
-