Skip to content

Apache Lucene open-source search software

LUCENE-1802: undeprecate current QueryParser

Michael McCandlesse166d54f8791
diff --git a/CHANGES.txt b/CHANGES.txt
index c8b0ae1679b..700f34f404f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -367,12 +367,7 @@ API Changes
34. LUCENE-1460: Changed TokenStreams/TokenFilters in contrib to
use the new TokenStream API. (Robert Muir, Michael Busch)
-35. LUCENE-1567: Deprecated Queryparser, which will be replaced by a
- new QueryParser framework in Lucene 3.0, that is currently located
- in contrib. (see New Features 35.)
- (Luis Alves and Adriano Campos via Michael Busch)
-
-36. LUCENE-1748: LUCENE-1001 introduced PayloadSpans, but this was a back
+35. LUCENE-1748: LUCENE-1001 introduced PayloadSpans, but this was a back
compat break and caused custom SpanQuery implementations to fail at runtime
in a variety of ways. This issue attempts to remedy things by causing
a compile time break on custom SpanQuery implementations and removing
@@ -657,23 +652,16 @@ New features
multiple fields with the same name are added to a document.
(Mike McCandless, Mark Miller, Michael Busch)
-32. LUCENE-1567: Added a new QueryParser framework to contrib, that
- allows implementing a new query syntax in a flexible and efficient
- way. This new QueryParser will be moved to Lucene's core in release
- 3.0 and will then replace the current core QueryParser, which
- has been deprecated with this patch.
- (Luis Alves and Adriano Campos via Michael Busch)
-
-33. LUCENE-1776: Add an option to not collect payloads for an ordered
+32. LUCENE-1776: Add an option to not collect payloads for an ordered
SpanNearQuery. Payloads were not lazily loaded in this case as
the javadocs implied. If you have payloads and want to use an ordered
SpanNearQuery that does not need to use the payloads, you can
disable loading them with a new constructor switch. (Mark Miller)
-34. LUCENE-1341: Added BoostingNearQuery to enable SpanNearQuery functionality
+33. LUCENE-1341: Added BoostingNearQuery to enable SpanNearQuery functionality
with payloads (Peter Keegan, Grant Ingersoll)
-35. LUCENE-1790: Added BoostingFunctionTermQuery to enable scoring of payloads
+34. LUCENE-1790: Added BoostingFunctionTermQuery to enable scoring of payloads
based on the maximum payload seen for a document.
Slight refactoring of Similarity and other payload queries (Grant Ingersoll)
diff --git a/contrib/queryparser/src/java/overview.html b/contrib/queryparser/src/java/overview.html
index cb8093bffe1..8bc8141bdf5 100644
--- a/contrib/queryparser/src/java/overview.html
+++ b/contrib/queryparser/src/java/overview.html
@@ -23,7 +23,7 @@
<h2>Apache Lucene Flexible Query Parser</h2>
<p>
-This contrib project contains the new Lucene query parser implementation, which is going to replace the old query parser on Lucene 3.0.
+This contrib project contains the new Lucene query parser implementation, which matches the syntax of the core QueryParser but offers a more modular architecture to enable customization.
</p>
<p>
diff --git a/src/java/org/apache/lucene/queryParser/CharStream.java b/src/java/org/apache/lucene/queryParser/CharStream.java
index c67321c1b38..9e546d50a41 100644
--- a/src/java/org/apache/lucene/queryParser/CharStream.java
+++ b/src/java/org/apache/lucene/queryParser/CharStream.java
@@ -15,8 +15,6 @@ package org.apache.lucene.queryParser;
* column number and the String that constitutes a token and are not used
* by the lexer. Hence their implementation won't affect the generated lexer's
* operation.
- *
- * @deprecated this class will be removed in Lucene 3.0, when the {@link QueryParser} is removed
*/
public interface CharStream {
diff --git a/src/java/org/apache/lucene/queryParser/FastCharStream.java b/src/java/org/apache/lucene/queryParser/FastCharStream.java
index 415ab9d099e..8c1a1b9a633 100644
--- a/src/java/org/apache/lucene/queryParser/FastCharStream.java
+++ b/src/java/org/apache/lucene/queryParser/FastCharStream.java
@@ -25,9 +25,6 @@ import java.io.*;
* this does not do line-number counting, but instead keeps track of the
* character position of the token in the input, as required by Lucene's {@link
* org.apache.lucene.analysis.Token} API.
- *
- * @deprecated this class will be removed in Lucene 3.0, when the {@link QueryParser} is removed
- *
* */
public final class FastCharStream implements CharStream {
char[] buffer = null;
diff --git a/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java b/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java
index 8d29c791f0a..a73dcfc8d01 100644
--- a/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java
+++ b/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java
@@ -31,9 +31,6 @@ import org.apache.lucene.search.Query;
/**
* A QueryParser which constructs queries to search multiple fields.
*
- * @deprecated use the equivalent class defined in the new <tt>queryparser</tt> project,
- * currently located in contrib: org.apache.lucene.queryParser.original.OriginalQueryParserHelper
- *
* @version $Revision$
*/
public class MultiFieldQueryParser extends QueryParser
diff --git a/src/java/org/apache/lucene/queryParser/ParseException.java b/src/java/org/apache/lucene/queryParser/ParseException.java
index 465bd9b155d..fdb47847a38 100644
--- a/src/java/org/apache/lucene/queryParser/ParseException.java
+++ b/src/java/org/apache/lucene/queryParser/ParseException.java
@@ -10,9 +10,6 @@ package org.apache.lucene.queryParser;
*
* You can modify this class to customize your error reporting
* mechanisms so long as you retain the public fields.
- *
- * @deprecated use the equivalent class defined in the new <tt>queryparser</tt> project,
- * currently located in contrib: org.apache.lucene.queryParser.original.parser.ParseException
*/
public class ParseException extends Exception {
diff --git a/src/java/org/apache/lucene/queryParser/QueryParser.java b/src/java/org/apache/lucene/queryParser/QueryParser.java
index 3d7dd5e48dc..369e59c80c1 100644
--- a/src/java/org/apache/lucene/queryParser/QueryParser.java
+++ b/src/java/org/apache/lucene/queryParser/QueryParser.java
@@ -96,10 +96,11 @@ import org.apache.lucene.util.Parameter;
* use a different method for date conversion.
* </p>
*
- * <p>Note that QueryParser is <em>not</em> thread-safe.</p>
+ * <p>Note that QueryParser is <em>not</em> thread-safe.</p>
*
- * @deprecated use the equivalent class defined in the new <tt>queryparser</tt> project,
- * currently located in contrib: org.apache.lucene.queryParser.original.OriginalQueryParserHelper
+ * <p><b>NOTE</b>: there is a new QueryParser in contrib, which matches
+ * the same syntax as this class, but is more modular,
+ * enabling substantial customization to how a query is created.
*/
public class QueryParser implements QueryParserConstants {
@@ -1590,6 +1591,16 @@ public class QueryParser implements QueryParserConstants {
finally { jj_save(0, xla); }
}
+ private boolean jj_3_1() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_2()) {
+ jj_scanpos = xsp;
+ if (jj_3R_3()) return true;
+ }
+ return false;
+ }
+
private boolean jj_3R_3() {
if (jj_scan_token(STAR)) return true;
if (jj_scan_token(COLON)) return true;
@@ -1602,16 +1613,6 @@ public class QueryParser implements QueryParserConstants {
return false;
}
- private boolean jj_3_1() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_2()) {
- jj_scanpos = xsp;
- if (jj_3R_3()) return true;
- }
- return false;
- }
-
/** Generated Token Manager. */
public QueryParserTokenManager token_source;
/** Current token. */
diff --git a/src/java/org/apache/lucene/queryParser/QueryParser.jj b/src/java/org/apache/lucene/queryParser/QueryParser.jj
index 309f28b893c..a481998a795 100644
--- a/src/java/org/apache/lucene/queryParser/QueryParser.jj
+++ b/src/java/org/apache/lucene/queryParser/QueryParser.jj
@@ -121,10 +121,10 @@ import org.apache.lucene.util.Parameter;
* </p>
*
* <p>Note that QueryParser is <em>not</em> thread-safe.</p>
- *
- * @deprecated use the equivalent class defined in the new <tt>queryparser</tt> project,
- * currently located in contrib: org.apache.lucene.queryParser.original.LuceneQueryParserHelper
- *
+ *
+ * <p><b>NOTE</b>: there is a new QueryParser in contrib, which matches
+ * the same syntax as this class, but is more modular,
+ * enabling substantial customization to how a query is created.
*/
public class QueryParser {
diff --git a/src/java/org/apache/lucene/queryParser/QueryParserConstants.java b/src/java/org/apache/lucene/queryParser/QueryParserConstants.java
index 3359f7c80d3..0073663cb42 100644
--- a/src/java/org/apache/lucene/queryParser/QueryParserConstants.java
+++ b/src/java/org/apache/lucene/queryParser/QueryParserConstants.java
@@ -5,10 +5,6 @@ package org.apache.lucene.queryParser;
/**
* Token literal values and constants.
* Generated by org.javacc.parser.OtherFilesGen#start()
- *
- * @deprecated use the equivalent class defined in the new <tt>queryparser</tt> project,
- * currently located in contrib: org.apache.lucene.queryParser.original.parser.TextParserConstants
- *
*/
public interface QueryParserConstants {
diff --git a/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java b/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java
index 3686967b791..2dc793f1dc5 100644
--- a/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java
+++ b/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java
@@ -34,11 +34,7 @@ import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.WildcardQuery;
import org.apache.lucene.util.Parameter;
-/** Token Manager.
- *
- * @deprecated use the equivalent class defined in the new <tt>queryparser</tt> project,
- * currently located in contrib: org.apache.lucene.queryParser.original.parser.TextParserTokenManager
- */
+/** Token Manager. */
public class QueryParserTokenManager implements QueryParserConstants
{
diff --git a/src/java/org/apache/lucene/queryParser/Token.java b/src/java/org/apache/lucene/queryParser/Token.java
index 173af6867b6..97677981cd7 100644
--- a/src/java/org/apache/lucene/queryParser/Token.java
+++ b/src/java/org/apache/lucene/queryParser/Token.java
@@ -4,10 +4,6 @@ package org.apache.lucene.queryParser;
/**
* Describes the input token stream.
- *
- * @deprecated use the equivalent class defined in the new <tt>queryparser</tt> project,
- * currently located in contrib: org.apache.lucene.queryParser.original.parser.Token
- *
*/
public class Token {
diff --git a/src/java/org/apache/lucene/queryParser/TokenMgrError.java b/src/java/org/apache/lucene/queryParser/TokenMgrError.java
index 601be367be2..2208bc238ae 100644
--- a/src/java/org/apache/lucene/queryParser/TokenMgrError.java
+++ b/src/java/org/apache/lucene/queryParser/TokenMgrError.java
@@ -2,12 +2,7 @@
/* JavaCCOptions: */
package org.apache.lucene.queryParser;
-/** Token Manager Error.
- *
- * @deprecated use the equivalent class defined in the new <tt>queryparser</tt> project,
- * currently located in contrib: org.apache.lucene.queryParser.original.parser.TokenMgrError
- *
- */
+/** Token Manager Error. */
public class TokenMgrError extends Error
{
diff --git a/src/java/org/apache/lucene/queryParser/package.html b/src/java/org/apache/lucene/queryParser/package.html
index 90e146e9282..d4017aa218f 100644
--- a/src/java/org/apache/lucene/queryParser/package.html
+++ b/src/java/org/apache/lucene/queryParser/package.html
@@ -20,7 +20,6 @@
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
-NOTE: Please look into lucene contrib/queryparser for the new flexible queryparser api.
A simple query parser implemented with JavaCC.
<p>Note that JavaCC defines lots of public classes, methods and fields
@@ -28,5 +27,9 @@ that do not need to be public.&nbsp; These clutter the documentation.&nbsp;
Sorry.
<p>Note that because JavaCC defines a class named <tt>Token</tt>, <tt>org.apache.lucene.analysis.Token</tt>
must always be fully qualified in source code in this package.
+
+<p><b>NOTE</b>: contrib/queryparser has an alternative queryparser that matches the syntax of this one, but is more modular,
+enabling substantial customization to how a query is created.
+
</body>
</html>