mirror of https://github.com/apache/lucene.git
LUCENE-1782: rename original -> standard in the new QueryParser
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@801934 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
835efd0d6c
commit
0b6769aa11
|
@ -0,0 +1,62 @@
|
|||
NOTE: often, if you are making a small change to the .jj file, you can
|
||||
simply run "ant javacc" and skip the steps below. JavaCC will print
|
||||
warnings like this:
|
||||
|
||||
Warning: ParseException.java: File is obsolete. Please rename or delete this file so that a new one can be generated for you.
|
||||
|
||||
which you should ignore (ie, simply keep the ParseException.java class
|
||||
that's already present).
|
||||
|
||||
If, instead, you'd like to fully rebuild the StandardQueryParser,
|
||||
here's how:
|
||||
|
||||
* Delete these files:
|
||||
|
||||
StandardQueryParser.java
|
||||
StandardQueryParserConstants.java
|
||||
StandardQueryParserTokenManager.java
|
||||
TokenMgrError.java
|
||||
JavaCharStream.java
|
||||
Token.java
|
||||
|
||||
* Run "ant javacc". That will generate the all the classes
|
||||
|
||||
* To avoid lots of warnings in the generated code:
|
||||
|
||||
add @SupressWarnings("all"), immediately preceding the class declaration to:
|
||||
|
||||
QueryParserTokenManager.java
|
||||
TokenMgrError.java
|
||||
JavaCharStream.java
|
||||
Token.java
|
||||
JavaCharStream.java
|
||||
|
||||
* Remove all imports from TokenMgrError.java
|
||||
|
||||
* Fix the ParseException class:
|
||||
|
||||
- Change it to extend from QueryNodeParseException:
|
||||
|
||||
"public class ParseException extends QueryNodeParseException".
|
||||
|
||||
- Recreate the all the constructors like this:
|
||||
|
||||
public ParseException(Token currentTokenVal,
|
||||
int[][] expectedTokenSequencesVal, String[] tokenImageVal) {
|
||||
super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, initialise(
|
||||
currentTokenVal, expectedTokenSequencesVal, tokenImageVal)));
|
||||
this.currentToken = currentTokenVal;
|
||||
this.expectedTokenSequences = expectedTokenSequencesVal;
|
||||
this.tokenImage = tokenImageVal;
|
||||
}
|
||||
|
||||
public ParseException(Message message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public ParseException() {
|
||||
super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error"));
|
||||
}
|
||||
|
||||
|
||||
- Fix all imports
|
|
@ -28,4 +28,13 @@
|
|||
|
||||
<import file="../contrib-build.xml"/>
|
||||
|
||||
<!--
|
||||
NOTE: see the README.javacc for details on how to fully regenerate the parser
|
||||
-->
|
||||
<target name="javacc" depends="init,javacc-check" if="javacc.present">
|
||||
<invoke-javacc target="src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.jj"
|
||||
outputDir="src/java/org/apache/lucene/queryParser/standard/parser"
|
||||
/>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.apache.lucene.queryParser.core.QueryNodeException;
|
|||
import org.apache.lucene.queryParser.core.messages.QueryParserMessages;
|
||||
import org.apache.lucene.queryParser.core.nodes.FieldableNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.original.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.queryParser.standard.parser.EscapeQuerySyntaxImpl;
|
||||
|
||||
/**
|
||||
* This class should be used when there is a builder for each type of node.
|
||||
|
|
|
@ -29,20 +29,20 @@ The package <tt>org.apache.lucene.queryParser.config</tt> contains query configu
|
|||
abstract class that all config handlers should extend.
|
||||
</p>
|
||||
<p>
|
||||
See {@link org.apache.lucene.queryParser.original.config.OriginalQueryConfigHandler} for a reference
|
||||
See {@link org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler} for a reference
|
||||
implementation.
|
||||
</p>
|
||||
<p>
|
||||
{@link org.apache.lucene.queryParser.core.config.FieldConfig} and {@link org.apache.lucene.queryParser.core.config.QueryConfigHandler}
|
||||
should use {@link org.apache.lucene.util.Attribute} to store all attributes
|
||||
required by the config implementation. See <tt>org.apache.lucene.queryParser.original.config.*Attribute</tt>
|
||||
required by the config implementation. See <tt>org.apache.lucene.queryParser.standard.config.*Attribute</tt>
|
||||
for reference implementation.
|
||||
</p>
|
||||
<p>
|
||||
The {@link org.apache.lucene.queryParser.core.config.QueryConfigHandler}, {@link org.apache.lucene.queryParser.core.config.FieldConfig},
|
||||
and {@link org.apache.lucene.util.Attribute}s are used in the processors to access config
|
||||
information in a flexible and independent way.
|
||||
See {@link org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor} for a
|
||||
See {@link org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor} for a
|
||||
reference implementation.
|
||||
</p>
|
||||
</body>
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
|
|||
* specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER]
|
||||
* [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]
|
||||
*
|
||||
* TODO: Add this to the future original Lucene parser/processor/builder
|
||||
* TODO: Add this to the future standard Lucene parser/processor/builder
|
||||
*/
|
||||
public class ProximityQueryNode extends BooleanQueryNode {
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ that represents a query node is {@link org.apache.lucene.queryParser.core.nodes.
|
|||
<p>
|
||||
{@link org.apache.lucene.queryParser.core.nodes.QueryNode}s are used by the text parser to create a syntax tree.
|
||||
These nodes are designed to be used by UI or other text parsers.
|
||||
The default Lucene text parser is {@link org.apache.lucene.queryParser.original.parser.OriginalSyntaxParser},
|
||||
it implements original syntax.
|
||||
The default Lucene text parser is {@link org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser},
|
||||
it implements Lucene's standard syntax.
|
||||
</p>
|
||||
<p>
|
||||
{@link org.apache.lucene.queryParser.core.nodes.QueryNode} interface should be implemented by all query nodes,
|
||||
|
@ -45,7 +45,7 @@ with all the nodes.
|
|||
</p>
|
||||
<p>
|
||||
A query node tree can also generate a query string that can be parsed back by the original text parser,
|
||||
at this point only the original lucene syntax is supported.
|
||||
at this point only the standard lucene syntax is supported.
|
||||
</p>
|
||||
<p>
|
||||
Grouping nodes:
|
||||
|
|
|
@ -35,7 +35,7 @@ Features:
|
|||
and build a processor pipeline, to implement the features you need</li>
|
||||
<li>Config Interfaces - Allow the consumer of the Query Parser to implement
|
||||
a diff Config Handler Objects to suite their needs.</li>
|
||||
<li>Original Builders - convert QueryNode's into several lucene
|
||||
<li>Standard Builders - convert QueryNode's into several lucene
|
||||
representations. Supported conversion is using a 2.4 compatible logic</li>
|
||||
<li>QueryNode tree's can be converted to a lucene 2.4 syntax string, using toQueryString</li>
|
||||
</ol>
|
||||
|
@ -99,21 +99,21 @@ messages, which is an important feature of a query parser.
|
|||
This design allows to develop different query syntaxes very quickly.
|
||||
</p>
|
||||
<p>
|
||||
A original lucene-compatible syntax is implemented using this new query parser
|
||||
API and is located under org.apache.lucene.queryParser.original.
|
||||
The standard (default) Lucene query parser is located under
|
||||
org.apache.lucene.queryParser.standard.
|
||||
<p>
|
||||
To make it simpler to use the new query parser
|
||||
the class {@link org.apache.lucene.queryParser.original.OriginalQueryParserHelper} may be helpful,
|
||||
the class {@link org.apache.lucene.queryParser.standard.StandardQueryParser} may be helpful,
|
||||
specially for people that do not want to extend the Query Parser.
|
||||
It uses the default Lucene query processors, text parser and builders, so
|
||||
you don't need to worry about dealing with those.
|
||||
|
||||
{@link org.apache.lucene.queryParser.original.OriginalQueryParserHelper} usage:
|
||||
{@link org.apache.lucene.queryParser.standard.StandardQueryParser} usage:
|
||||
<ul>
|
||||
OriginalQueryParserHelper qpHelper = new OriginalQueryParserHelper();
|
||||
StandardQueryParser qpHelper = new StandardQueryParser();
|
||||
|
||||
<br/><br/>
|
||||
OriginalQueryConfigHandler config = qpHelper.getQueryConfigHandler();
|
||||
StandardQueryConfigHandler config = qpHelper.getQueryConfigHandler();
|
||||
<br/><br/>
|
||||
config.setAllowLeadingWildcard(true);
|
||||
<br/><br/>
|
||||
|
@ -122,7 +122,7 @@ config.setAnalyzer(new WhitespaceAnalyzer());
|
|||
Query query = qpHelper.parse("apache AND lucene", "defaultField");
|
||||
</ul>
|
||||
To make it easy for people who are using current Lucene's query parser to switch to
|
||||
the new one, there is a {@link org.apache.lucene.queryParser.original.QueryParserWrapper} under org.apache.lucene.queryParser.original
|
||||
the new one, there is a {@link org.apache.lucene.queryParser.standard.QueryParserWrapper} under org.apache.lucene.queryParser.standard
|
||||
that keeps the old query parser interface, but uses the new query parser infrastructure.
|
||||
</p>
|
||||
</p>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original;
|
||||
package org.apache.lucene.queryParser.standard;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -76,7 +76,7 @@ public class MultiFieldQueryParserWrapper extends QueryParserWrapper {
|
|||
@SuppressWarnings("unchecked")
|
||||
public MultiFieldQueryParserWrapper(String[] fields, Analyzer analyzer, Map boosts) {
|
||||
this(fields, analyzer);
|
||||
OriginalQueryParserHelper qpHelper = (OriginalQueryParserHelper) getQueryParserHelper();
|
||||
StandardQueryParser qpHelper = (StandardQueryParser) getQueryParserHelper();
|
||||
|
||||
qpHelper.setMultiFields(fields);
|
||||
qpHelper.setFieldsBoost(boosts);
|
||||
|
@ -112,7 +112,7 @@ public MultiFieldQueryParserWrapper(String[] fields, Analyzer analyzer, Map boos
|
|||
public MultiFieldQueryParserWrapper(String[] fields, Analyzer analyzer) {
|
||||
super(null, analyzer);
|
||||
|
||||
OriginalQueryParserHelper qpHelper = (OriginalQueryParserHelper) getQueryParserHelper();
|
||||
StandardQueryParser qpHelper = (StandardQueryParser) getQueryParserHelper();
|
||||
qpHelper.setAnalyzer(analyzer);
|
||||
|
||||
qpHelper.setMultiFields(fields);
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original;
|
||||
package org.apache.lucene.queryParser.standard;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.queryParser.core.QueryNodeException;
|
||||
|
@ -39,7 +39,7 @@ final public class QueryParserUtil {
|
|||
throw new IllegalArgumentException("queries.length != fields.length");
|
||||
BooleanQuery bQuery = new BooleanQuery();
|
||||
|
||||
OriginalQueryParserHelper qp = new OriginalQueryParserHelper();
|
||||
StandardQueryParser qp = new StandardQueryParser();
|
||||
qp.setAnalyzer(analyzer);
|
||||
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
|
@ -95,7 +95,7 @@ final public class QueryParserUtil {
|
|||
throw new IllegalArgumentException("fields.length != flags.length");
|
||||
BooleanQuery bQuery = new BooleanQuery();
|
||||
|
||||
OriginalQueryParserHelper qp = new OriginalQueryParserHelper();
|
||||
StandardQueryParser qp = new StandardQueryParser();
|
||||
qp.setAnalyzer(analyzer);
|
||||
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
|
@ -152,7 +152,7 @@ final public class QueryParserUtil {
|
|||
"queries, fields, and flags array have have different length");
|
||||
BooleanQuery bQuery = new BooleanQuery();
|
||||
|
||||
OriginalQueryParserHelper qp = new OriginalQueryParserHelper();
|
||||
StandardQueryParser qp = new StandardQueryParser();
|
||||
qp.setAnalyzer(analyzer);
|
||||
|
||||
for (int i = 0; i < fields.length; i++) {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original;
|
||||
package org.apache.lucene.queryParser.standard;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -34,21 +34,21 @@ import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
|||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.parser.SyntaxParser;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.original.builders.OriginalQueryBuilder;
|
||||
import org.apache.lucene.queryParser.original.builders.OriginalQueryTreeBuilder;
|
||||
import org.apache.lucene.queryParser.original.config.AllowLeadingWildcardAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.AnalyzerAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.MultiTermRewriteMethodAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.DateResolutionAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.DefaultPhraseSlopAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.LocaleAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.LowercaseExpandedTermsAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.OriginalQueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.config.PositionIncrementsAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.RangeCollatorAttribute;
|
||||
import org.apache.lucene.queryParser.original.parser.OriginalSyntaxParser;
|
||||
import org.apache.lucene.queryParser.original.processors.OriginalQueryNodeProcessorPipeline;
|
||||
import org.apache.lucene.queryParser.standard.builders.StandardQueryBuilder;
|
||||
import org.apache.lucene.queryParser.standard.builders.StandardQueryTreeBuilder;
|
||||
import org.apache.lucene.queryParser.standard.config.AllowLeadingWildcardAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.AnalyzerAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.MultiTermRewriteMethodAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.DateResolutionAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.DefaultPhraseSlopAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.LocaleAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.LowercaseExpandedTermsAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.standard.config.PositionIncrementsAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.RangeCollatorAttribute;
|
||||
import org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser;
|
||||
import org.apache.lucene.queryParser.standard.processors.StandardQueryNodeProcessorPipeline;
|
||||
import org.apache.lucene.search.FuzzyQuery;
|
||||
import org.apache.lucene.search.MultiTermQuery;
|
||||
import org.apache.lucene.search.Query;
|
||||
|
@ -108,31 +108,31 @@ public class QueryParserWrapper {
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
private SyntaxParser syntaxParser = new OriginalSyntaxParser();
|
||||
private SyntaxParser syntaxParser = new StandardSyntaxParser();
|
||||
|
||||
private OriginalQueryConfigHandler config;
|
||||
private OriginalQueryParserHelper qpHelper;
|
||||
private StandardQueryConfigHandler config;
|
||||
private StandardQueryParser qpHelper;
|
||||
|
||||
private QueryNodeProcessor processorPipeline;
|
||||
|
||||
private OriginalQueryBuilder builder = new OriginalQueryTreeBuilder();
|
||||
private StandardQueryBuilder builder = new StandardQueryTreeBuilder();
|
||||
|
||||
private String defaultField;
|
||||
|
||||
public QueryParserWrapper(String defaultField, Analyzer analyzer) {
|
||||
this.defaultField = defaultField;
|
||||
|
||||
this.qpHelper = new OriginalQueryParserHelper();
|
||||
this.qpHelper = new StandardQueryParser();
|
||||
|
||||
this.config = (OriginalQueryConfigHandler) qpHelper.getQueryConfigHandler();
|
||||
this.config = (StandardQueryConfigHandler) qpHelper.getQueryConfigHandler();
|
||||
|
||||
this.qpHelper.setAnalyzer(analyzer);
|
||||
|
||||
this.processorPipeline = new OriginalQueryNodeProcessorPipeline(this.config);
|
||||
this.processorPipeline = new StandardQueryNodeProcessorPipeline(this.config);
|
||||
|
||||
}
|
||||
|
||||
OriginalQueryParserHelper getQueryParserHelper() {
|
||||
StandardQueryParser getQueryParserHelper() {
|
||||
return qpHelper;
|
||||
}
|
||||
|
||||
|
@ -153,20 +153,20 @@ public class QueryParserWrapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link OriginalQueryBuilder} used to generate a {@link Query} object
|
||||
* Sets the {@link StandardQueryBuilder} used to generate a {@link Query} object
|
||||
* from the parsed and processed query node tree.
|
||||
*
|
||||
* @param builder
|
||||
* the builder
|
||||
*/
|
||||
public void setQueryBuilder(OriginalQueryBuilder builder) {
|
||||
public void setQueryBuilder(StandardQueryBuilder builder) {
|
||||
this.builder = builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link QueryNodeProcessor} used to process the query node tree
|
||||
* generated by the
|
||||
* {@link org.apache.lucene.queryParser.original.parser.OriginalSyntaxParser}.
|
||||
* {@link org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser}.
|
||||
*
|
||||
* @param processor
|
||||
* the processor
|
||||
|
@ -184,7 +184,7 @@ public class QueryParserWrapper {
|
|||
* @param queryConfig
|
||||
* the query config handler
|
||||
*/
|
||||
public void setQueryConfig(OriginalQueryConfigHandler queryConfig) {
|
||||
public void setQueryConfig(StandardQueryConfigHandler queryConfig) {
|
||||
this.config = queryConfig;
|
||||
|
||||
if (this.processorPipeline != null) {
|
||||
|
@ -205,7 +205,7 @@ public class QueryParserWrapper {
|
|||
/**
|
||||
* Returns {@link QueryNodeProcessor} used to process the query node tree
|
||||
* generated by the
|
||||
* {@link org.apache.lucene.queryParser.original.parser.OriginalSyntaxParser}.
|
||||
* {@link org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser}.
|
||||
*
|
||||
* @return the query processor
|
||||
*/
|
||||
|
@ -375,8 +375,8 @@ public class QueryParserWrapper {
|
|||
public void setDefaultOperator(Operator op) {
|
||||
|
||||
this.qpHelper
|
||||
.setDefaultOperator(OR_OPERATOR.equals(op) ? org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute.Operator.OR
|
||||
: org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute.Operator.AND);
|
||||
.setDefaultOperator(OR_OPERATOR.equals(op) ? org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute.Operator.OR
|
||||
: org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute.Operator.AND);
|
||||
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ public class QueryParserWrapper {
|
|||
&& this.config.hasAttribute(DefaultOperatorAttribute.class)) {
|
||||
|
||||
return (((DefaultOperatorAttribute) this.config
|
||||
.getAttribute(DefaultOperatorAttribute.class)).getOperator() == org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute.Operator.AND) ? AND_OPERATOR
|
||||
.getAttribute(DefaultOperatorAttribute.class)).getOperator() == org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute.Operator.AND) ? AND_OPERATOR
|
||||
: OR_OPERATOR;
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original;
|
||||
package org.apache.lucene.queryParser.standard;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -27,26 +27,26 @@ import org.apache.lucene.document.DateTools;
|
|||
import org.apache.lucene.queryParser.core.QueryNodeException;
|
||||
import org.apache.lucene.queryParser.core.QueryParserHelper;
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.builders.OriginalQueryTreeBuilder;
|
||||
import org.apache.lucene.queryParser.original.config.AllowLeadingWildcardAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.AnalyzerAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.DateResolutionAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.FieldDateResolutionMapAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.DefaultPhraseSlopAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.FieldBoostMapAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.FuzzyAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.LocaleAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.LowercaseExpandedTermsAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.MultiFieldAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.MultiTermRewriteMethodAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.OriginalQueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.config.PositionIncrementsAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.RangeCollatorAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute.Operator;
|
||||
import org.apache.lucene.queryParser.original.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.queryParser.original.parser.OriginalSyntaxParser;
|
||||
import org.apache.lucene.queryParser.original.processors.OriginalQueryNodeProcessorPipeline;
|
||||
import org.apache.lucene.queryParser.standard.builders.StandardQueryTreeBuilder;
|
||||
import org.apache.lucene.queryParser.standard.config.AllowLeadingWildcardAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.AnalyzerAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.DateResolutionAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.FieldDateResolutionMapAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.DefaultPhraseSlopAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.FieldBoostMapAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.FuzzyAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.LocaleAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.LowercaseExpandedTermsAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.MultiFieldAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.MultiTermRewriteMethodAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.standard.config.PositionIncrementsAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.RangeCollatorAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute.Operator;
|
||||
import org.apache.lucene.queryParser.standard.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser;
|
||||
import org.apache.lucene.queryParser.standard.processors.StandardQueryNodeProcessorPipeline;
|
||||
import org.apache.lucene.search.FuzzyQuery;
|
||||
import org.apache.lucene.search.MultiTermQuery;
|
||||
import org.apache.lucene.search.Query;
|
||||
|
@ -60,15 +60,15 @@ import org.apache.lucene.search.Query;
|
|||
* To construct a Query object from a query string, use the
|
||||
* {@link #parse(String, String)} method:
|
||||
* <ul>
|
||||
* OriginalQueryParserHelper queryParserHelper = new OriginalQueryParserHelper(); <br/>
|
||||
* StandardQueryParser queryParserHelper = new StandardQueryParser(); <br/>
|
||||
* Query query = queryParserHelper.parse("a AND b", "defaultField");
|
||||
* </ul>
|
||||
* <p>
|
||||
* To change any configuration before parsing the query string do, for example:
|
||||
* <p/>
|
||||
* <ul>
|
||||
* // the query config handler returned by {@link OriginalQueryParserHelper} is a
|
||||
* {@link OriginalQueryConfigHandler} <br/>
|
||||
* // the query config handler returned by {@link StandardQueryParser} is a
|
||||
* {@link StandardQueryConfigHandler} <br/>
|
||||
* queryParserHelper.getQueryConfigHandler().setAnalyzer(new
|
||||
* WhitespaceAnalyzer());
|
||||
* </ul>
|
||||
|
@ -105,53 +105,53 @@ import org.apache.lucene.search.Query;
|
|||
* </p>
|
||||
* </ul>
|
||||
* <p>
|
||||
* The text parser used by this helper is a {@link OriginalSyntaxParser}.
|
||||
* The text parser used by this helper is a {@link StandardSyntaxParser}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* The query node processor used by this helper is a
|
||||
* {@link OriginalQueryNodeProcessorPipeline}.
|
||||
* {@link StandardQueryNodeProcessorPipeline}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* The builder used by this helper is a {@link OriginalQueryTreeBuilder}.
|
||||
* The builder used by this helper is a {@link StandardQueryTreeBuilder}.
|
||||
* <p/>
|
||||
*
|
||||
* @see OriginalQueryParserHelper
|
||||
* @see OriginalQueryConfigHandler
|
||||
* @see OriginalSyntaxParser
|
||||
* @see OriginalQueryNodeProcessorPipeline
|
||||
* @see OriginalQueryTreeBuilder
|
||||
* @see StandardQueryParser
|
||||
* @see StandardQueryConfigHandler
|
||||
* @see StandardSyntaxParser
|
||||
* @see StandardQueryNodeProcessorPipeline
|
||||
* @see StandardQueryTreeBuilder
|
||||
*/
|
||||
public class OriginalQueryParserHelper extends QueryParserHelper {
|
||||
public class StandardQueryParser extends QueryParserHelper {
|
||||
|
||||
/**
|
||||
* Constructs a {@link OriginalQueryParserHelper} object.
|
||||
* Constructs a {@link StandardQueryParser} object.
|
||||
*/
|
||||
public OriginalQueryParserHelper() {
|
||||
super(new OriginalQueryConfigHandler(), new OriginalSyntaxParser(),
|
||||
new OriginalQueryNodeProcessorPipeline(null),
|
||||
new OriginalQueryTreeBuilder());
|
||||
public StandardQueryParser() {
|
||||
super(new StandardQueryConfigHandler(), new StandardSyntaxParser(),
|
||||
new StandardQueryNodeProcessorPipeline(null),
|
||||
new StandardQueryTreeBuilder());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a {@link OriginalQueryParserHelper} object and sets an
|
||||
* Constructs a {@link StandardQueryParser} object and sets an
|
||||
* {@link Analyzer} to it. The same as:
|
||||
*
|
||||
* <ul>
|
||||
* OriginalQueryParserHelper qp = new OriginalQueryParserHelper();
|
||||
* StandardQueryParser qp = new StandardQueryParser();
|
||||
* qp.getQueryConfigHandler().setAnalyzer(analyzer);
|
||||
* </ul>
|
||||
*
|
||||
* @param analyzer
|
||||
* the analyzer to be used by this query parser helper
|
||||
*/
|
||||
public OriginalQueryParserHelper(Analyzer analyzer) {
|
||||
public StandardQueryParser(Analyzer analyzer) {
|
||||
this();
|
||||
|
||||
this.setAnalyzer(analyzer);
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return "<OriginalQueryParserHelper config=\"" + this.getQueryConfigHandler() + "\"/>";
|
||||
return "<StandardQueryParser config=\"" + this.getQueryConfigHandler() + "\"/>";
|
||||
}
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -30,7 +30,7 @@ import org.apache.lucene.search.BooleanQuery;
|
|||
import org.apache.lucene.search.Query;
|
||||
import org.apache.lucene.search.BooleanQuery.TooManyClauses;
|
||||
|
||||
public class AnyQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class AnyQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public AnyQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -26,7 +26,7 @@ import org.apache.lucene.queryParser.core.messages.QueryParserMessages;
|
|||
import org.apache.lucene.queryParser.core.nodes.BooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ModifierQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.original.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.queryParser.standard.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.search.BooleanClause;
|
||||
import org.apache.lucene.search.BooleanQuery;
|
||||
import org.apache.lucene.search.Query;
|
||||
|
@ -41,7 +41,7 @@ import org.apache.lucene.search.BooleanQuery.TooManyClauses;
|
|||
* It takes in consideration if the children is a {@link ModifierQueryNode} to
|
||||
* define the {@link BooleanClause}.
|
||||
*/
|
||||
public class BooleanQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class BooleanQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public BooleanQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -29,7 +29,7 @@ import org.apache.lucene.search.Query;
|
|||
* {@link QueryTreeBuilder#QUERY_TREE_BUILDER_TAGID} and applies the boost value
|
||||
* defined in the {@link BoostQueryNode}.
|
||||
*/
|
||||
public class BoostQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class BoostQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public BoostQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -26,7 +26,7 @@ import org.apache.lucene.search.TermQuery;
|
|||
/**
|
||||
* Builds a {@link TermQuery} object from a {@link FieldQueryNode} object.
|
||||
*/
|
||||
public class FieldQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class FieldQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public FieldQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -26,7 +26,7 @@ import org.apache.lucene.search.FuzzyQuery;
|
|||
/**
|
||||
* Builds a {@link FuzzyQuery} object from a {@link FuzzyQueryNode} object.
|
||||
*/
|
||||
public class FuzzyQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class FuzzyQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public FuzzyQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -28,7 +28,7 @@ import org.apache.lucene.search.Query;
|
|||
* {@link GroupQueryNode} object using a
|
||||
* {@link QueryTreeBuilder#QUERY_TREE_BUILDER_TAGID} tag.
|
||||
*/
|
||||
public class GroupQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class GroupQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public GroupQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -22,14 +22,14 @@ import org.apache.lucene.queryParser.core.QueryNodeException;
|
|||
import org.apache.lucene.queryParser.core.messages.QueryParserMessages;
|
||||
import org.apache.lucene.queryParser.core.nodes.MatchAllDocsQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.original.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.queryParser.standard.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.search.MatchAllDocsQuery;
|
||||
|
||||
/**
|
||||
* Builds a {@link MatchAllDocsQuery} object from a
|
||||
* {@link MatchAllDocsQueryNode} object.
|
||||
*/
|
||||
public class MatchAllDocsQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class MatchAllDocsQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public MatchAllDocsQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -22,14 +22,14 @@ import org.apache.lucene.queryParser.core.QueryNodeException;
|
|||
import org.apache.lucene.queryParser.core.messages.QueryParserMessages;
|
||||
import org.apache.lucene.queryParser.core.nodes.MatchNoDocsQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.original.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.queryParser.standard.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.search.BooleanQuery;
|
||||
|
||||
/**
|
||||
* Builds an empty {@link BooleanQuery} object from a
|
||||
* {@link MatchNoDocsQueryNode} object.
|
||||
*/
|
||||
public class MatchNoDocsQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class MatchNoDocsQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public MatchNoDocsQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -28,7 +28,7 @@ import org.apache.lucene.search.Query;
|
|||
* {@link ModifierQueryNode} object using a
|
||||
* {@link QueryTreeBuilder#QUERY_TREE_BUILDER_TAGID} tag.
|
||||
*/
|
||||
public class ModifierQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class ModifierQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public ModifierQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -26,7 +26,7 @@ import org.apache.lucene.queryParser.core.QueryNodeException;
|
|||
import org.apache.lucene.queryParser.core.builders.QueryTreeBuilder;
|
||||
import org.apache.lucene.queryParser.core.nodes.FieldQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.original.nodes.MultiPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.nodes.MultiPhraseQueryNode;
|
||||
import org.apache.lucene.search.MultiPhraseQuery;
|
||||
import org.apache.lucene.search.TermQuery;
|
||||
|
||||
|
@ -34,7 +34,7 @@ import org.apache.lucene.search.TermQuery;
|
|||
* Builds a {@link MultiPhraseQuery} object from a {@link MultiPhraseQueryNode}
|
||||
* object.
|
||||
*/
|
||||
public class MultiPhraseQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class MultiPhraseQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public MultiPhraseQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -31,7 +31,7 @@ import org.apache.lucene.search.TermQuery;
|
|||
* Builds a {@link PhraseQuery} object from a {@link TokenizedPhraseQueryNode}
|
||||
* object.
|
||||
*/
|
||||
public class PhraseQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class PhraseQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public PhraseQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -27,7 +27,7 @@ import org.apache.lucene.search.PrefixQuery;
|
|||
* Builds a {@link PrefixQuery} object from a {@link PrefixWildcardQueryNode}
|
||||
* object.
|
||||
*/
|
||||
public class PrefixWildcardQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class PrefixWildcardQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public PrefixWildcardQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -21,13 +21,13 @@ import org.apache.lucene.queryParser.core.QueryNodeException;
|
|||
import org.apache.lucene.queryParser.core.nodes.ParametricQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ParametricQueryNode.CompareOperator;
|
||||
import org.apache.lucene.queryParser.original.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.search.TermRangeQuery;
|
||||
|
||||
/**
|
||||
* Builds a {@link TermRangeQuery} object from a {@link RangeQueryNode} object.
|
||||
*/
|
||||
public class RangeQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class RangeQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public RangeQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -31,7 +31,7 @@ import org.apache.lucene.search.Query;
|
|||
* {@link QueryTreeBuilder#QUERY_TREE_BUILDER_TAGID} and applies the slop value
|
||||
* defined in the {@link SlopQueryNode}.
|
||||
*/
|
||||
public class SlopQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class SlopQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public SlopQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -26,8 +26,8 @@ import org.apache.lucene.queryParser.core.messages.QueryParserMessages;
|
|||
import org.apache.lucene.queryParser.core.nodes.ModifierQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ModifierQueryNode.Modifier;
|
||||
import org.apache.lucene.queryParser.original.nodes.OriginalBooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.original.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.search.BooleanClause;
|
||||
import org.apache.lucene.search.BooleanQuery;
|
||||
import org.apache.lucene.search.Query;
|
||||
|
@ -43,14 +43,14 @@ import org.apache.lucene.search.BooleanQuery.TooManyClauses;
|
|||
* @see BooleanQuery
|
||||
* @see Similarity#coord(int, int)
|
||||
*/
|
||||
public class OriginalBooleanQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class StandardBooleanQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public OriginalBooleanQueryNodeBuilder() {
|
||||
public StandardBooleanQueryNodeBuilder() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
|
||||
OriginalBooleanQueryNode booleanNode = (OriginalBooleanQueryNode) queryNode;
|
||||
StandardBooleanQueryNode booleanNode = (StandardBooleanQueryNode) queryNode;
|
||||
|
||||
BooleanQuery bQuery = new BooleanQuery(booleanNode.isDisableCoord());
|
||||
List<QueryNode> children = booleanNode.getChildren();
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -30,7 +30,7 @@ import org.apache.lucene.search.Query;
|
|||
* @see QueryBuilder
|
||||
* @see QueryTreeBuilder
|
||||
*/
|
||||
public interface OriginalQueryBuilder extends QueryBuilder {
|
||||
public interface StandardQueryBuilder extends QueryBuilder {
|
||||
|
||||
public Query build(QueryNode queryNode) throws QueryNodeException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -32,25 +32,25 @@ import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.SlopQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.TokenizedPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.WildcardQueryNode;
|
||||
import org.apache.lucene.queryParser.original.nodes.OriginalBooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.original.nodes.MultiPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.original.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.queryParser.original.processors.OriginalQueryNodeProcessorPipeline;
|
||||
import org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.nodes.MultiPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.processors.StandardQueryNodeProcessorPipeline;
|
||||
import org.apache.lucene.search.Query;
|
||||
|
||||
/**
|
||||
* This query tree builder only defines the necessary map to build a
|
||||
* {@link Query} tree object. It should be used to generate a {@link Query} tree
|
||||
* object from a query node tree processed by a
|
||||
* {@link OriginalQueryNodeProcessorPipeline}. <br/>
|
||||
* {@link StandardQueryNodeProcessorPipeline}. <br/>
|
||||
*
|
||||
* @see QueryTreeBuilder
|
||||
* @see OriginalQueryNodeProcessorPipeline
|
||||
* @see StandardQueryNodeProcessorPipeline
|
||||
*/
|
||||
public class OriginalQueryTreeBuilder extends QueryTreeBuilder implements
|
||||
OriginalQueryBuilder {
|
||||
public class StandardQueryTreeBuilder extends QueryTreeBuilder implements
|
||||
StandardQueryBuilder {
|
||||
|
||||
public OriginalQueryTreeBuilder() {
|
||||
public StandardQueryTreeBuilder() {
|
||||
setBuilder(GroupQueryNode.class, new GroupQueryNodeBuilder());
|
||||
setBuilder(FieldQueryNode.class, new FieldQueryNodeBuilder());
|
||||
setBuilder(BooleanQueryNode.class, new BooleanQueryNodeBuilder());
|
||||
|
@ -64,8 +64,8 @@ public class OriginalQueryTreeBuilder extends QueryTreeBuilder implements
|
|||
new PrefixWildcardQueryNodeBuilder());
|
||||
setBuilder(RangeQueryNode.class, new RangeQueryNodeBuilder());
|
||||
setBuilder(SlopQueryNode.class, new SlopQueryNodeBuilder());
|
||||
setBuilder(OriginalBooleanQueryNode.class,
|
||||
new OriginalBooleanQueryNodeBuilder());
|
||||
setBuilder(StandardBooleanQueryNode.class,
|
||||
new StandardBooleanQueryNodeBuilder());
|
||||
setBuilder(MultiPhraseQueryNode.class, new MultiPhraseQueryNodeBuilder());
|
||||
setBuilder(MatchAllDocsQueryNode.class, new MatchAllDocsQueryNodeBuilder());
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.builders;
|
||||
package org.apache.lucene.queryParser.standard.builders;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -27,7 +27,7 @@ import org.apache.lucene.search.WildcardQuery;
|
|||
* Builds a {@link WildcardQuery} object from a {@link WildcardQueryNode}
|
||||
* object.
|
||||
*/
|
||||
public class WildcardQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class WildcardQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public WildcardQueryNodeBuilder() {
|
||||
// empty constructor
|
|
@ -21,14 +21,14 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Original Lucene Query Node Builders</h2>
|
||||
<h2>Standard Lucene Query Node Builders</h2>
|
||||
<p>
|
||||
The package org.apache.lucene.queryParser.original.builders contains all the builders needed
|
||||
The package org.apache.lucene.queryParser.standard.builders contains all the builders needed
|
||||
to build a Lucene Query object from a query node tree. These builders expect the query node tree was
|
||||
already processed by the {@link org.apache.lucene.queryParser.original.processors.OriginalQueryNodeProcessorPipeline}.
|
||||
already processed by the {@link org.apache.lucene.queryParser.standard.processors.StandardQueryNodeProcessorPipeline}.
|
||||
</p>
|
||||
<p>
|
||||
{@link org.apache.lucene.queryParser.original.builders.OriginalQueryTreeBuilder} is a builder that already contains a defined map that maps each QueryNode object
|
||||
{@link org.apache.lucene.queryParser.standard.builders.StandardQueryTreeBuilder} is a builder that already contains a defined map that maps each QueryNode object
|
||||
with its respective builder.
|
||||
</p>
|
||||
</body>
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.AllowLeadingWildcardProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.AllowLeadingWildcardProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.AllowLeadingWildcardProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.AllowLeadingWildcardProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* must be defined in the {@link QueryConfigHandler}. It basically tells the
|
||||
* processor if it should allow leading wildcard. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.AllowLeadingWildcardAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.AllowLeadingWildcardAttribute
|
||||
*/
|
||||
public class AllowLeadingWildcardAttributeImpl extends AttributeImpl
|
||||
implements AllowLeadingWildcardAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -19,7 +19,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.AnalyzerQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.AnalyzerQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -19,7 +19,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.AnalyzerQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.AnalyzerQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* processor the {@link Analyzer}, if there is one, which will be used to
|
||||
* analyze the query terms. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.AnalyzerAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.AnalyzerAttribute
|
||||
*/
|
||||
public class AnalyzerAttributeImpl extends AttributeImpl
|
||||
implements AnalyzerAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.FieldConfig;
|
||||
import org.apache.lucene.queryParser.original.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.FieldConfig;
|
||||
import org.apache.lucene.queryParser.original.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* defined to it. <br/>
|
||||
* <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.BoostAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.BoostAttribute
|
||||
*/
|
||||
public class BoostAttributeImpl extends AttributeImpl
|
||||
implements BoostAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -20,8 +20,8 @@ package org.apache.lucene.queryParser.original.config;
|
|||
import org.apache.lucene.document.DateTools;
|
||||
import org.apache.lucene.document.DateTools.Resolution;
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -20,7 +20,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
import org.apache.lucene.document.DateTools;
|
||||
import org.apache.lucene.document.DateTools.Resolution;
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* and must be defined in the {@link QueryConfigHandler}. This attribute tells
|
||||
* the processor which {@link Resolution} to use when parsing the date. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.DateResolutionAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.DateResolutionAttribute
|
||||
*/
|
||||
public class DateResolutionAttributeImpl extends AttributeImpl
|
||||
implements DateResolutionAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.GroupQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.GroupQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.GroupQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.GroupQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* processor which is the default boolean operator when no operator is defined
|
||||
* between terms. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute
|
||||
*/
|
||||
public class DefaultOperatorAttributeImpl extends AttributeImpl
|
||||
implements DefaultOperatorAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.PhraseSlopQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.PhraseSlopQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.PhraseSlopQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.PhraseSlopQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* processor what is the default phrase slop when no slop is defined in a
|
||||
* phrase. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute
|
||||
*/
|
||||
public class DefaultPhraseSlopAttributeImpl extends AttributeImpl
|
||||
implements DefaultPhraseSlopAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -21,7 +21,7 @@ import java.util.LinkedHashMap;
|
|||
import java.util.Map;
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.FieldConfig;
|
||||
import org.apache.lucene.queryParser.original.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -31,7 +31,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* defined to it. <br/>
|
||||
* <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.BoostAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.BoostAttribute
|
||||
*/
|
||||
public class FieldBoostMapAttributeImpl extends AttributeImpl
|
||||
implements FieldBoostMapAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.PhraseSlopQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.PhraseSlopQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.PhraseSlopQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.PhraseSlopQueryNodeProcessor;
|
||||
import org.apache.lucene.search.FuzzyQuery;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
|
@ -28,7 +28,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* processor what is the default phrase slop when no slop is defined in a
|
||||
* phrase. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.FuzzyAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.FuzzyAttribute
|
||||
*/
|
||||
public class FuzzyAttributeImpl extends AttributeImpl
|
||||
implements FuzzyAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -20,7 +20,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -20,7 +20,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* and must be defined in the {@link QueryConfigHandler}. This attribute tells
|
||||
* the processor what is the default {@link Locale} used to parse a date. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.LocaleAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.LocaleAttribute
|
||||
*/
|
||||
public class LocaleAttributeImpl extends AttributeImpl
|
||||
implements LocaleAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -20,7 +20,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -20,7 +20,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* and must be defined in the {@link QueryConfigHandler}. This attribute tells
|
||||
* the processor what is the default {@link Locale} used to parse a date. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.LowercaseExpandedTermsAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.LowercaseExpandedTermsAttribute
|
||||
*/
|
||||
public class LowercaseExpandedTermsAttributeImpl extends AttributeImpl
|
||||
implements LowercaseExpandedTermsAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -20,7 +20,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
import java.util.Arrays;
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.MultiFieldQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* must be defined in the {@link QueryConfigHandler}. This attribute tells the
|
||||
* processor to which fields the terms in the query should be expanded. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.MultiFieldAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.MultiFieldAttribute
|
||||
*/
|
||||
public class MultiFieldAttributeImpl extends AttributeImpl
|
||||
implements MultiFieldAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.search.MultiTermQuery;
|
||||
import org.apache.lucene.search.MultiTermQuery.RewriteMethod;
|
||||
import org.apache.lucene.util.Attribute;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.search.MultiTermQuery;
|
||||
import org.apache.lucene.search.MultiTermQuery.RewriteMethod;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.AnalyzerQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.AnalyzerQueryNodeProcessor;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,7 +18,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.AnalyzerQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.AnalyzerQueryNodeProcessor;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* must be defined in the {@link QueryConfigHandler}. This attribute tells the
|
||||
* processor if the position increment is enabled. <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.PositionIncrementsAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.PositionIncrementsAttribute
|
||||
*/
|
||||
public class PositionIncrementsAttributeImpl extends AttributeImpl
|
||||
implements PositionIncrementsAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -20,7 +20,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
import java.text.Collator;
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.search.TermRangeQuery;
|
||||
import org.apache.lucene.util.Attribute;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -20,7 +20,7 @@ package org.apache.lucene.queryParser.original.config;
|
|||
import java.text.Collator;
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.search.TermRangeQuery;
|
||||
import org.apache.lucene.util.AttributeImpl;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import org.apache.lucene.util.AttributeImpl;
|
|||
* the processor which {@link Collator} should be used for a
|
||||
* {@link TermRangeQuery} <br/>
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.RangeCollatorAttribute
|
||||
* @see org.apache.lucene.queryParser.standard.config.RangeCollatorAttribute
|
||||
*/
|
||||
public class RangeCollatorAttributeImpl extends AttributeImpl
|
||||
implements RangeCollatorAttribute {
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.config;
|
||||
package org.apache.lucene.queryParser.standard.config;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -18,21 +18,21 @@ package org.apache.lucene.queryParser.original.config;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.processors.OriginalQueryNodeProcessorPipeline;
|
||||
import org.apache.lucene.queryParser.standard.processors.StandardQueryNodeProcessorPipeline;
|
||||
|
||||
/**
|
||||
* This query configuration handler is used for almost every processor defined
|
||||
* in the {@link OriginalQueryNodeProcessorPipeline} processor pipeline. It holds
|
||||
* in the {@link StandardQueryNodeProcessorPipeline} processor pipeline. It holds
|
||||
* attributes that reproduces the configuration that could be set on the old
|
||||
* lucene 2.4 QueryParser class. <br/>
|
||||
*
|
||||
* @see OriginalQueryNodeProcessorPipeline
|
||||
* @see StandardQueryNodeProcessorPipeline
|
||||
*/
|
||||
public class OriginalQueryConfigHandler extends QueryConfigHandler {
|
||||
public class StandardQueryConfigHandler extends QueryConfigHandler {
|
||||
|
||||
|
||||
|
||||
public OriginalQueryConfigHandler() {
|
||||
public StandardQueryConfigHandler() {
|
||||
// Add listener that will build the FieldConfig attributes.
|
||||
addFieldConfigListener(new FieldBoostMapFCListener(this));
|
||||
addFieldConfigListener(new FieldDateResolutionFCListener(this));
|
|
@ -21,14 +21,14 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Original Lucene Query Configuration</h2>
|
||||
<h2>Standard Lucene Query Configuration</h2>
|
||||
<p>
|
||||
The package org.apache.lucene.queryParser.original.config contains the Lucene
|
||||
The package org.apache.lucene.queryParser.standard.config contains the Lucene
|
||||
query configuration handler and all the attributes used by it. This configuration
|
||||
handler reproduces almost everything that could be set on the old query parser.
|
||||
</p>
|
||||
<p>
|
||||
OriginalQueryConfigHandler is the class that should be used to configure the OriginalQueryNodeProcessorPipeline.
|
||||
StandardQueryConfigHandler is the class that should be used to configure the StandardQueryNodeProcessorPipeline.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.nodes;
|
||||
package org.apache.lucene.queryParser.standard.nodes;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -19,7 +19,7 @@ package org.apache.lucene.queryParser.original.nodes;
|
|||
|
||||
import org.apache.lucene.queryParser.core.nodes.ModifierQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.original.processors.GroupQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.processors.GroupQueryNodeProcessor;
|
||||
|
||||
/**
|
||||
* A {@link BooleanModifierNode} has the same behaviour as
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.nodes;
|
||||
package org.apache.lucene.queryParser.standard.nodes;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.nodes;
|
||||
package org.apache.lucene.queryParser.standard.nodes;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -21,8 +21,8 @@ import java.text.Collator;
|
|||
|
||||
import org.apache.lucene.queryParser.core.nodes.ParametricQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ParametricRangeQueryNode;
|
||||
import org.apache.lucene.queryParser.original.config.RangeCollatorAttribute;
|
||||
import org.apache.lucene.queryParser.original.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.standard.config.RangeCollatorAttribute;
|
||||
import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNodeProcessor;
|
||||
import org.apache.lucene.search.MultiTermQuery;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.nodes;
|
||||
package org.apache.lucene.queryParser.standard.nodes;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -25,14 +25,14 @@ import org.apache.lucene.search.BooleanQuery;
|
|||
import org.apache.lucene.search.Similarity;
|
||||
|
||||
/**
|
||||
* A {@link OriginalBooleanQueryNode} has the same behavior as
|
||||
* A {@link StandardBooleanQueryNode} has the same behavior as
|
||||
* {@link BooleanQueryNode}. It only indicates if the coord should be enabled or
|
||||
* not for this boolean query. <br/>
|
||||
*
|
||||
* @see Similarity#coord(int, int)
|
||||
* @see BooleanQuery
|
||||
*/
|
||||
public class OriginalBooleanQueryNode extends BooleanQueryNode {
|
||||
public class StandardBooleanQueryNode extends BooleanQueryNode {
|
||||
|
||||
private static final long serialVersionUID = 1938287817191138787L;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class OriginalBooleanQueryNode extends BooleanQueryNode {
|
|||
/**
|
||||
* @param clauses
|
||||
*/
|
||||
public OriginalBooleanQueryNode(List<QueryNode> clauses, boolean disableCoord) {
|
||||
public StandardBooleanQueryNode(List<QueryNode> clauses, boolean disableCoord) {
|
||||
super(clauses);
|
||||
|
||||
this.disableCoord = disableCoord;
|
|
@ -21,9 +21,9 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Original Lucene Query Nodes</h2>
|
||||
<h2>Standard Lucene Query Nodes</h2>
|
||||
<p>
|
||||
The package org.apache.lucene.queryParser.original.nodes contains QueryNode classes
|
||||
The package org.apache.lucene.queryParser.standard.nodes contains QueryNode classes
|
||||
that are used specifically for Lucene query node tree. Any other generic QueryNode is
|
||||
defined under org.apache.lucene.queryParser.nodes.
|
||||
</p>
|
|
@ -31,12 +31,12 @@ parsing was divided in 3 steps: parsing (syntax), processing (semantic)
|
|||
and building.
|
||||
</p>
|
||||
<p>
|
||||
The classes contained in the package org.apache.lucene.queryParser.original
|
||||
The classes contained in the package org.apache.lucene.queryParser.standard
|
||||
are used to reproduce the same behavior as the old query parser.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Check <tt>org.apache.lucene.queryParser.original.OriginalQueryParserHelper</tt> to quick start using the Lucene query parser.
|
||||
Check <tt>org.apache.lucene.queryParser.standard.StandardQueryParser</tt> to quick start using the Lucene query parser.
|
||||
</p>
|
||||
|
||||
<p>
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.parser;
|
||||
package org.apache.lucene.queryParser.standard.parser;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -1,6 +1,6 @@
|
|||
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 4.1 */
|
||||
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
|
||||
package org.apache.lucene.queryParser.original.parser;
|
||||
package org.apache.lucene.queryParser.standard.parser;
|
||||
|
||||
/**
|
||||
* An implementation of interface CharStream, where the stream is assumed to
|
||||
|
@ -614,4 +614,4 @@ class JavaCharStream
|
|||
}
|
||||
|
||||
}
|
||||
/* JavaCC - OriginalChecksum=065d79d49fcd02f542903038e37bd9d9 (do not edit this line) */
|
||||
/* JavaCC - StandardChecksum=065d79d49fcd02f542903038e37bd9d9 (do not edit this line) */
|
|
@ -1,6 +1,6 @@
|
|||
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 4.1 */
|
||||
/* JavaCCOptions:KEEP_LINE_COL=null */
|
||||
package org.apache.lucene.queryParser.original.parser;
|
||||
package org.apache.lucene.queryParser.standard.parser;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -192,6 +192,6 @@ public class ParseException extends QueryNodeParseException {
|
|||
|
||||
}
|
||||
/*
|
||||
* JavaCC - OriginalChecksum=c04ac45b94787832e67e6d1b49d8774c (do not edit this
|
||||
* JavaCC - StandardChecksum=c04ac45b94787832e67e6d1b49d8774c (do not edit this
|
||||
* line)
|
||||
*/
|
|
@ -1,5 +1,5 @@
|
|||
/* Generated By:JavaCC: Do not edit this line. OriginalSyntaxParser.java */
|
||||
package org.apache.lucene.queryParser.original.parser;
|
||||
/* Generated By:JavaCC: Do not edit this line. StandardSyntaxParser.java */
|
||||
package org.apache.lucene.queryParser.standard.parser;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -50,7 +50,7 @@ import org.apache.lucene.queryParser.core.nodes.WildcardQueryNode;
|
|||
import org.apache.lucene.queryParser.core.parser.SyntaxParser;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class OriginalSyntaxParser implements SyntaxParser, OriginalSyntaxParserConstants {
|
||||
public class StandardSyntaxParser implements SyntaxParser, StandardSyntaxParserConstants {
|
||||
|
||||
private static final int CONJ_NONE =0;
|
||||
private static final int CONJ_AND =2;
|
||||
|
@ -58,7 +58,7 @@ public class OriginalSyntaxParser implements SyntaxParser, OriginalSyntaxParserC
|
|||
|
||||
|
||||
// syntax parser constructor
|
||||
public OriginalSyntaxParser() {
|
||||
public StandardSyntaxParser() {
|
||||
this(new StringReader(""));
|
||||
}
|
||||
/** Parses a query string, returning a {@link org.apache.lucene.queryParser.core.nodes.QueryNode}.
|
||||
|
@ -668,7 +668,7 @@ public class OriginalSyntaxParser implements SyntaxParser, OriginalSyntaxParserC
|
|||
}
|
||||
|
||||
/** Generated Token Manager. */
|
||||
public OriginalSyntaxParserTokenManager token_source;
|
||||
public StandardSyntaxParserTokenManager token_source;
|
||||
JavaCharStream jj_input_stream;
|
||||
/** Current token. */
|
||||
public Token token;
|
||||
|
@ -696,13 +696,13 @@ public class OriginalSyntaxParser implements SyntaxParser, OriginalSyntaxParserC
|
|||
private int jj_gc = 0;
|
||||
|
||||
/** Constructor with InputStream. */
|
||||
public OriginalSyntaxParser(java.io.InputStream stream) {
|
||||
public StandardSyntaxParser(java.io.InputStream stream) {
|
||||
this(stream, null);
|
||||
}
|
||||
/** Constructor with InputStream and supplied encoding */
|
||||
public OriginalSyntaxParser(java.io.InputStream stream, String encoding) {
|
||||
public StandardSyntaxParser(java.io.InputStream stream, String encoding) {
|
||||
try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
|
||||
token_source = new OriginalSyntaxParserTokenManager(jj_input_stream);
|
||||
token_source = new StandardSyntaxParserTokenManager(jj_input_stream);
|
||||
token = new Token();
|
||||
jj_ntk = -1;
|
||||
jj_gen = 0;
|
||||
|
@ -726,9 +726,9 @@ public class OriginalSyntaxParser implements SyntaxParser, OriginalSyntaxParserC
|
|||
}
|
||||
|
||||
/** Constructor. */
|
||||
public OriginalSyntaxParser(java.io.Reader stream) {
|
||||
public StandardSyntaxParser(java.io.Reader stream) {
|
||||
jj_input_stream = new JavaCharStream(stream, 1, 1);
|
||||
token_source = new OriginalSyntaxParserTokenManager(jj_input_stream);
|
||||
token_source = new StandardSyntaxParserTokenManager(jj_input_stream);
|
||||
token = new Token();
|
||||
jj_ntk = -1;
|
||||
jj_gen = 0;
|
||||
|
@ -748,7 +748,7 @@ public class OriginalSyntaxParser implements SyntaxParser, OriginalSyntaxParserC
|
|||
}
|
||||
|
||||
/** Constructor with generated Token Manager. */
|
||||
public OriginalSyntaxParser(OriginalSyntaxParserTokenManager tm) {
|
||||
public StandardSyntaxParser(StandardSyntaxParserTokenManager tm) {
|
||||
token_source = tm;
|
||||
token = new Token();
|
||||
jj_ntk = -1;
|
||||
|
@ -758,7 +758,7 @@ public class OriginalSyntaxParser implements SyntaxParser, OriginalSyntaxParserC
|
|||
}
|
||||
|
||||
/** Reinitialise. */
|
||||
public void ReInit(OriginalSyntaxParserTokenManager tm) {
|
||||
public void ReInit(StandardSyntaxParserTokenManager tm) {
|
||||
token_source = tm;
|
||||
token = new Token();
|
||||
jj_ntk = -1;
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Original file is based on the TextParser.jj from lucene 2.3
|
||||
* Standard file is based on the TextParser.jj from lucene 2.3
|
||||
*/
|
||||
|
||||
options {
|
||||
|
@ -10,8 +10,8 @@ options {
|
|||
JDK_VERSION="1.5";
|
||||
}
|
||||
|
||||
PARSER_BEGIN(OriginalSyntaxParser)
|
||||
package org.apache.lucene.queryParser.original.parser;
|
||||
PARSER_BEGIN(StandardSyntaxParser)
|
||||
package org.apache.lucene.queryParser.standard.parser;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -62,7 +62,7 @@ import org.apache.lucene.queryParser.core.nodes.WildcardQueryNode;
|
|||
import org.apache.lucene.queryParser.core.parser.SyntaxParser;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class OriginalSyntaxParser implements SyntaxParser {
|
||||
public class StandardSyntaxParser implements SyntaxParser {
|
||||
|
||||
private static final int CONJ_NONE =0;
|
||||
private static final int CONJ_AND =2;
|
||||
|
@ -70,7 +70,7 @@ public class OriginalSyntaxParser implements SyntaxParser {
|
|||
|
||||
|
||||
// syntax parser constructor
|
||||
public OriginalSyntaxParser() {
|
||||
public StandardSyntaxParser() {
|
||||
this(new StringReader(""));
|
||||
}
|
||||
/** Parses a query string, returning a {@link org.apache.lucene.queryParser.core.nodes.QueryNode}.
|
||||
|
@ -99,7 +99,7 @@ public class OriginalSyntaxParser implements SyntaxParser {
|
|||
|
||||
}
|
||||
|
||||
PARSER_END(OriginalSyntaxParser)
|
||||
PARSER_END(StandardSyntaxParser)
|
||||
|
||||
/* ***************** */
|
||||
/* Token Definitions */
|
|
@ -1,12 +1,12 @@
|
|||
/* Generated By:JavaCC: Do not edit this line. OriginalSyntaxParserConstants.java */
|
||||
package org.apache.lucene.queryParser.original.parser;
|
||||
/* Generated By:JavaCC: Do not edit this line. StandardSyntaxParserConstants.java */
|
||||
package org.apache.lucene.queryParser.standard.parser;
|
||||
|
||||
|
||||
/**
|
||||
* Token literal values and constants.
|
||||
* Generated by org.javacc.parser.OtherFilesGen#start()
|
||||
*/
|
||||
public interface OriginalSyntaxParserConstants {
|
||||
public interface StandardSyntaxParserConstants {
|
||||
|
||||
/** End of File. */
|
||||
int EOF = 0;
|
|
@ -1,5 +1,5 @@
|
|||
/* Generated By:JavaCC: Do not edit this line. OriginalSyntaxParserTokenManager.java */
|
||||
package org.apache.lucene.queryParser.original.parser;
|
||||
/* Generated By:JavaCC: Do not edit this line. StandardSyntaxParserTokenManager.java */
|
||||
package org.apache.lucene.queryParser.standard.parser;
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
|
@ -17,10 +17,38 @@ package org.apache.lucene.queryParser.original.parser;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
import org.apache.lucene.messages.Message;
|
||||
import org.apache.lucene.messages.MessageImpl;
|
||||
import org.apache.lucene.queryParser.core.QueryNodeError;
|
||||
import org.apache.lucene.queryParser.core.QueryNodeException;
|
||||
import org.apache.lucene.queryParser.core.QueryNodeParseException;
|
||||
import org.apache.lucene.queryParser.core.messages.QueryParserMessages;
|
||||
import org.apache.lucene.queryParser.core.nodes.AndQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.BooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.BoostQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.FieldQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.FuzzyQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ModifierQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.GroupQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.OpaqueQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.OrQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ParametricQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ParametricRangeQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.PrefixWildcardQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.SlopQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ProximityQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNodeImpl;
|
||||
import org.apache.lucene.queryParser.core.nodes.QuotedFieldQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.WildcardQueryNode;
|
||||
import org.apache.lucene.queryParser.core.parser.SyntaxParser;
|
||||
|
||||
/** Token Manager. */
|
||||
@SuppressWarnings("unused")
|
||||
public class OriginalSyntaxParserTokenManager implements OriginalSyntaxParserConstants
|
||||
public class StandardSyntaxParserTokenManager implements StandardSyntaxParserConstants
|
||||
{
|
||||
|
||||
/** Debug output. */
|
||||
|
@ -1058,14 +1086,14 @@ private final int[] jjrounds = new int[36];
|
|||
private final int[] jjstateSet = new int[72];
|
||||
protected char curChar;
|
||||
/** Constructor. */
|
||||
public OriginalSyntaxParserTokenManager(JavaCharStream stream){
|
||||
public StandardSyntaxParserTokenManager(JavaCharStream stream){
|
||||
if (JavaCharStream.staticFlag)
|
||||
throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
|
||||
input_stream = stream;
|
||||
}
|
||||
|
||||
/** Constructor. */
|
||||
public OriginalSyntaxParserTokenManager(JavaCharStream stream, int lexState){
|
||||
public StandardSyntaxParserTokenManager(JavaCharStream stream, int lexState){
|
||||
this(stream);
|
||||
SwitchTo(lexState);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/* Generated By:JavaCC: Do not edit this line. Token.java Version 4.1 */
|
||||
/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
|
||||
package org.apache.lucene.queryParser.original.parser;
|
||||
package org.apache.lucene.queryParser.standard.parser;
|
||||
|
||||
/**
|
||||
* Describes the input token stream.
|
||||
|
@ -128,4 +128,4 @@ public class Token implements java.io.Serializable {
|
|||
}
|
||||
|
||||
}
|
||||
/* JavaCC - OriginalChecksum=f9eb36a076cde62bf39ccbf828bc2117 (do not edit this line) */
|
||||
/* JavaCC - StandardChecksum=f9eb36a076cde62bf39ccbf828bc2117 (do not edit this line) */
|
|
@ -1,6 +1,6 @@
|
|||
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 4.1 */
|
||||
/* JavaCCOptions: */
|
||||
package org.apache.lucene.queryParser.original.parser;
|
||||
package org.apache.lucene.queryParser.standard.parser;
|
||||
|
||||
/** Token Manager Error. */
|
||||
public class TokenMgrError extends Error
|
||||
|
@ -144,4 +144,4 @@ public class TokenMgrError extends Error
|
|||
this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
|
||||
}
|
||||
}
|
||||
/* JavaCC - OriginalChecksum=91ba9c9f5e0e552a815530d639ce15ed (do not edit this line) */
|
||||
/* JavaCC - StandardChecksum=91ba9c9f5e0e552a815530d639ce15ed (do not edit this line) */
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
<h2>Lucene Query Parser</h2>
|
||||
<p>
|
||||
The package org.apache.lucene.queryParser.original.parser contains the query parser.
|
||||
The package org.apache.lucene.queryParser.standard.parser contains the query parser.
|
||||
</p>
|
||||
<p>
|
||||
This text parser only performs the syntax validation and creates an QueryNode tree
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -26,8 +26,8 @@ import org.apache.lucene.queryParser.core.messages.QueryParserMessages;
|
|||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.WildcardQueryNode;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.config.AllowLeadingWildcardAttribute;
|
||||
import org.apache.lucene.queryParser.original.parser.EscapeQuerySyntaxImpl;
|
||||
import org.apache.lucene.queryParser.standard.config.AllowLeadingWildcardAttribute;
|
||||
import org.apache.lucene.queryParser.standard.parser.EscapeQuerySyntaxImpl;
|
||||
|
||||
/**
|
||||
* This processor verifies if the attribute
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -40,10 +40,10 @@ import org.apache.lucene.queryParser.core.nodes.TextableQueryNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.TokenizedPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.WildcardQueryNode;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.config.AnalyzerAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.PositionIncrementsAttribute;
|
||||
import org.apache.lucene.queryParser.original.nodes.OriginalBooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.original.nodes.MultiPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.config.AnalyzerAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.PositionIncrementsAttribute;
|
||||
import org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.nodes.MultiPhraseQueryNode;
|
||||
|
||||
/**
|
||||
* This processor verifies if the attribute {@link AnalyzerQueryNodeProcessor}
|
||||
|
@ -209,7 +209,7 @@ public class AnalyzerQueryNodeProcessor extends QueryNodeProcessorImpl {
|
|||
|
||||
}
|
||||
|
||||
return new GroupQueryNode(new OriginalBooleanQueryNode(children, true));
|
||||
return new GroupQueryNode(new StandardBooleanQueryNode(children, true));
|
||||
|
||||
} else {
|
||||
// phrase query:
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -25,7 +25,7 @@ import org.apache.lucene.queryParser.core.nodes.ModifierQueryNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ModifierQueryNode.Modifier;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.nodes.BooleanModifierNode;
|
||||
import org.apache.lucene.queryParser.standard.nodes.BooleanModifierNode;
|
||||
|
||||
/**
|
||||
* This processor removes every {@link BooleanQueryNode} that contains only one
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -26,7 +26,7 @@ import org.apache.lucene.queryParser.core.nodes.BoostQueryNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.FieldableNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.config.BoostAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.BoostAttribute;
|
||||
|
||||
/**
|
||||
* This processor iterates the query node tree looking for every
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -25,8 +25,8 @@ import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.SlopQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.TokenizedPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.config.DefaultPhraseSlopAttribute;
|
||||
import org.apache.lucene.queryParser.original.nodes.MultiPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.config.DefaultPhraseSlopAttribute;
|
||||
import org.apache.lucene.queryParser.standard.nodes.MultiPhraseQueryNode;
|
||||
|
||||
/**
|
||||
* This processor verifies if the attribute {@link DefaultPhraseSlopAttribute}
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -24,7 +24,7 @@ import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
|||
import org.apache.lucene.queryParser.core.nodes.FuzzyQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.config.FuzzyAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.FuzzyAttribute;
|
||||
import org.apache.lucene.search.FuzzyQuery;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -31,9 +31,9 @@ import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.ModifierQueryNode.Modifier;
|
||||
import org.apache.lucene.queryParser.core.parser.SyntaxParser;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.DefaultOperatorAttribute.Operator;
|
||||
import org.apache.lucene.queryParser.original.nodes.BooleanModifierNode;
|
||||
import org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute.Operator;
|
||||
import org.apache.lucene.queryParser.standard.nodes.BooleanModifierNode;
|
||||
|
||||
/**
|
||||
* The {@link SyntaxParser}
|
||||
|
@ -47,7 +47,7 @@ import org.apache.lucene.queryParser.original.nodes.BooleanModifierNode;
|
|||
*
|
||||
* Example: TODO: describe a good example to show how this processor works
|
||||
*
|
||||
* @see org.apache.lucene.queryParser.original.config.OriginalQueryConfigHandler
|
||||
* @see org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler
|
||||
*/
|
||||
public class GroupQueryNodeProcessor implements QueryNodeProcessor {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -27,7 +27,7 @@ import org.apache.lucene.queryParser.core.nodes.ParametricQueryNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.WildcardQueryNode;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.config.LowercaseExpandedTermsAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.LowercaseExpandedTermsAttribute;
|
||||
|
||||
/**
|
||||
* This processor verifies if the attribute
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -27,7 +27,7 @@ import org.apache.lucene.queryParser.core.nodes.FieldableNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.GroupQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.config.MultiFieldAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.MultiFieldAttribute;
|
||||
|
||||
/**
|
||||
* This processor is used to expand terms so the query looks for the same term
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -35,11 +35,11 @@ import org.apache.lucene.queryParser.core.nodes.ParametricRangeQueryNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.ParametricQueryNode.CompareOperator;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.config.MultiTermRewriteMethodAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.DateResolutionAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.LocaleAttribute;
|
||||
import org.apache.lucene.queryParser.original.config.RangeCollatorAttribute;
|
||||
import org.apache.lucene.queryParser.original.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.config.MultiTermRewriteMethodAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.DateResolutionAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.LocaleAttribute;
|
||||
import org.apache.lucene.queryParser.standard.config.RangeCollatorAttribute;
|
||||
import org.apache.lucene.queryParser.standard.nodes.RangeQueryNode;
|
||||
import org.apache.lucene.search.MultiTermQuery;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -24,7 +24,7 @@ import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
|||
import org.apache.lucene.queryParser.core.nodes.SlopQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.TokenizedPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.nodes.MultiPhraseQueryNode;
|
||||
import org.apache.lucene.queryParser.standard.nodes.MultiPhraseQueryNode;
|
||||
|
||||
/**
|
||||
* This processor removes invalid {@link SlopQueryNode} objects in the query
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -23,11 +23,11 @@ import org.apache.lucene.queryParser.core.QueryNodeException;
|
|||
import org.apache.lucene.queryParser.core.nodes.PrefixWildcardQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl;
|
||||
import org.apache.lucene.queryParser.original.parser.OriginalSyntaxParser;
|
||||
import org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser;
|
||||
import org.apache.lucene.search.PrefixQuery;
|
||||
|
||||
/**
|
||||
* The {@link OriginalSyntaxParser} creates {@link PrefixWildcardQueryNode} nodes which
|
||||
* The {@link StandardSyntaxParser} creates {@link PrefixWildcardQueryNode} nodes which
|
||||
* have values containing the prefixed wildcard. However, Lucene
|
||||
* {@link PrefixQuery} cannot contain the prefixed wildcard. So, this processor
|
||||
* basically removed the prefixed wildcard from the
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.lucene.queryParser.original.processors;
|
||||
package org.apache.lucene.queryParser.standard.processors;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -21,31 +21,31 @@ import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
|
|||
import org.apache.lucene.queryParser.core.processors.NoChildOptimizationQueryNodeProcessor;
|
||||
import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorPipeline;
|
||||
import org.apache.lucene.queryParser.core.processors.RemoveDeletedQueryNodesProcessor;
|
||||
import org.apache.lucene.queryParser.original.builders.OriginalQueryTreeBuilder;
|
||||
import org.apache.lucene.queryParser.original.config.OriginalQueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.original.parser.OriginalSyntaxParser;
|
||||
import org.apache.lucene.queryParser.standard.builders.StandardQueryTreeBuilder;
|
||||
import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler;
|
||||
import org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser;
|
||||
import org.apache.lucene.search.Query;
|
||||
|
||||
/**
|
||||
* This pipeline has all the processors needed to process a query node tree,
|
||||
* generated by {@link OriginalSyntaxParser}, already assembled. <br/>
|
||||
* generated by {@link StandardSyntaxParser}, already assembled. <br/>
|
||||
* <br/>
|
||||
* The order they are assembled affects the results. <br/>
|
||||
* <br/>
|
||||
* This processor pipeline was designed to work with
|
||||
* {@link OriginalQueryConfigHandler}. <br/>
|
||||
* {@link StandardQueryConfigHandler}. <br/>
|
||||
* <br/>
|
||||
* The result query node tree can be used to build a {@link Query} object using
|
||||
* {@link OriginalQueryTreeBuilder}. <br/>
|
||||
* {@link StandardQueryTreeBuilder}. <br/>
|
||||
*
|
||||
* @see OriginalQueryTreeBuilder
|
||||
* @see OriginalQueryConfigHandler
|
||||
* @see OriginalSyntaxParser
|
||||
* @see StandardQueryTreeBuilder
|
||||
* @see StandardQueryConfigHandler
|
||||
* @see StandardSyntaxParser
|
||||
*/
|
||||
public class OriginalQueryNodeProcessorPipeline extends
|
||||
public class StandardQueryNodeProcessorPipeline extends
|
||||
QueryNodeProcessorPipeline {
|
||||
|
||||
public OriginalQueryNodeProcessorPipeline(QueryConfigHandler queryConfig) {
|
||||
public StandardQueryNodeProcessorPipeline(QueryConfigHandler queryConfig) {
|
||||
super(queryConfig);
|
||||
|
||||
addProcessor(new MultiFieldQueryNodeProcessor());
|
|
@ -23,11 +23,11 @@
|
|||
|
||||
<h2>Lucene Query Node Processors</h2>
|
||||
<p>
|
||||
The package org.apache.lucene.queryParser.original.processors contains every processor needed to assembly a pipeline
|
||||
The package org.apache.lucene.queryParser.standard.processors contains every processor needed to assembly a pipeline
|
||||
that modifies the query node tree according to the actual Lucene queries.
|
||||
</p>
|
||||
<p>
|
||||
This processors are already assembled correctly in the OriginalQueryNodeProcessorPipeline.
|
||||
This processors are already assembled correctly in the StandardQueryNodeProcessorPipeline.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -31,7 +31,7 @@ It's currently divided in 3 main packages:
|
|||
<ul>
|
||||
<li>{@link org.apache.lucene.messages}: it contains the API to defined lazily loaded messages. This message API is used by the new query parser to support localized messages.</li>
|
||||
<li>{@link org.apache.lucene.queryParser.core}: it contains the query parser API classes, which should be extended by query parser implementations. </li>
|
||||
<li>{@link org.apache.lucene.queryParser.original}: it contains the current Lucene query parser implementation using the new query parser API.</li>
|
||||
<li>{@link org.apache.lucene.queryParser.standard}: it contains the current Lucene query parser implementation using the new query parser API.</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.apache.lucene.queryParser.core.QueryNodeException;
|
|||
import org.apache.lucene.queryParser.core.builders.QueryTreeBuilder;
|
||||
import org.apache.lucene.queryParser.core.nodes.BooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.original.builders.OriginalQueryBuilder;
|
||||
import org.apache.lucene.queryParser.standard.builders.StandardQueryBuilder;
|
||||
import org.apache.lucene.search.spans.SpanOrQuery;
|
||||
import org.apache.lucene.search.spans.SpanQuery;
|
||||
|
||||
|
@ -33,7 +33,7 @@ import org.apache.lucene.search.spans.SpanQuery;
|
|||
*
|
||||
* It assumes that the {@link BooleanQueryNode} instance has at least one child.
|
||||
*/
|
||||
public class SpanOrQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class SpanOrQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public SpanOrQuery build(QueryNode node) throws QueryNodeException {
|
||||
|
||||
|
|
|
@ -21,14 +21,14 @@ import org.apache.lucene.index.Term;
|
|||
import org.apache.lucene.queryParser.core.QueryNodeException;
|
||||
import org.apache.lucene.queryParser.core.nodes.FieldQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.original.builders.OriginalQueryBuilder;
|
||||
import org.apache.lucene.queryParser.standard.builders.StandardQueryBuilder;
|
||||
import org.apache.lucene.search.spans.SpanTermQuery;
|
||||
|
||||
/**
|
||||
* This builder creates {@link SpanTermQuery}s from a {@link FieldQueryNode}
|
||||
* object.
|
||||
*/
|
||||
public class SpanTermQueryNodeBuilder implements OriginalQueryBuilder {
|
||||
public class SpanTermQueryNodeBuilder implements StandardQueryBuilder {
|
||||
|
||||
public SpanTermQuery build(QueryNode node) throws QueryNodeException {
|
||||
FieldQueryNode fieldQueryNode = (FieldQueryNode) node;
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.apache.lucene.queryParser.core.builders.QueryTreeBuilder;
|
|||
import org.apache.lucene.queryParser.core.nodes.BooleanQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.FieldQueryNode;
|
||||
import org.apache.lucene.queryParser.core.nodes.QueryNode;
|
||||
import org.apache.lucene.queryParser.original.builders.OriginalQueryBuilder;
|
||||
import org.apache.lucene.queryParser.standard.builders.StandardQueryBuilder;
|
||||
import org.apache.lucene.search.spans.SpanQuery;
|
||||
|
||||
/**
|
||||
|
@ -36,7 +36,7 @@ import org.apache.lucene.search.spans.SpanQuery;
|
|||
*
|
||||
*/
|
||||
public class SpansQueryTreeBuilder extends QueryTreeBuilder implements
|
||||
OriginalQueryBuilder {
|
||||
StandardQueryBuilder {
|
||||
|
||||
public SpansQueryTreeBuilder() {
|
||||
setBuilder(BooleanQueryNode.class, new SpanOrQueryNodeBuilder());
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue