mirror of https://github.com/apache/lucene.git
LUCENE-1802: undeprecate current QueryParser
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@804016 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1eb8149fb3
commit
e166d54f87
20
CHANGES.txt
20
CHANGES.txt
|
@ -367,12 +367,7 @@ API Changes
|
||||||
34. LUCENE-1460: Changed TokenStreams/TokenFilters in contrib to
|
34. LUCENE-1460: Changed TokenStreams/TokenFilters in contrib to
|
||||||
use the new TokenStream API. (Robert Muir, Michael Busch)
|
use the new TokenStream API. (Robert Muir, Michael Busch)
|
||||||
|
|
||||||
35. LUCENE-1567: Deprecated Queryparser, which will be replaced by a
|
35. LUCENE-1748: LUCENE-1001 introduced PayloadSpans, but this was a back
|
||||||
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
|
|
||||||
compat break and caused custom SpanQuery implementations to fail at runtime
|
compat break and caused custom SpanQuery implementations to fail at runtime
|
||||||
in a variety of ways. This issue attempts to remedy things by causing
|
in a variety of ways. This issue attempts to remedy things by causing
|
||||||
a compile time break on custom SpanQuery implementations and removing
|
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.
|
multiple fields with the same name are added to a document.
|
||||||
(Mike McCandless, Mark Miller, Michael Busch)
|
(Mike McCandless, Mark Miller, Michael Busch)
|
||||||
|
|
||||||
32. LUCENE-1567: Added a new QueryParser framework to contrib, that
|
32. LUCENE-1776: Add an option to not collect payloads for an ordered
|
||||||
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
|
|
||||||
SpanNearQuery. Payloads were not lazily loaded in this case as
|
SpanNearQuery. Payloads were not lazily loaded in this case as
|
||||||
the javadocs implied. If you have payloads and want to use an ordered
|
the javadocs implied. If you have payloads and want to use an ordered
|
||||||
SpanNearQuery that does not need to use the payloads, you can
|
SpanNearQuery that does not need to use the payloads, you can
|
||||||
disable loading them with a new constructor switch. (Mark Miller)
|
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)
|
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.
|
based on the maximum payload seen for a document.
|
||||||
Slight refactoring of Similarity and other payload queries (Grant Ingersoll)
|
Slight refactoring of Similarity and other payload queries (Grant Ingersoll)
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<h2>Apache Lucene Flexible Query Parser</h2>
|
<h2>Apache Lucene Flexible Query Parser</h2>
|
||||||
|
|
||||||
<p>
|
<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>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -15,8 +15,6 @@ package org.apache.lucene.queryParser;
|
||||||
* column number and the String that constitutes a token and are not used
|
* 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
|
* by the lexer. Hence their implementation won't affect the generated lexer's
|
||||||
* operation.
|
* operation.
|
||||||
*
|
|
||||||
* @deprecated this class will be removed in Lucene 3.0, when the {@link QueryParser} is removed
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface CharStream {
|
public interface CharStream {
|
||||||
|
|
|
@ -25,9 +25,6 @@ import java.io.*;
|
||||||
* this does not do line-number counting, but instead keeps track of the
|
* 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
|
* character position of the token in the input, as required by Lucene's {@link
|
||||||
* org.apache.lucene.analysis.Token} API.
|
* 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 {
|
public final class FastCharStream implements CharStream {
|
||||||
char[] buffer = null;
|
char[] buffer = null;
|
||||||
|
|
|
@ -31,9 +31,6 @@ import org.apache.lucene.search.Query;
|
||||||
/**
|
/**
|
||||||
* A QueryParser which constructs queries to search multiple fields.
|
* 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$
|
* @version $Revision$
|
||||||
*/
|
*/
|
||||||
public class MultiFieldQueryParser extends QueryParser
|
public class MultiFieldQueryParser extends QueryParser
|
||||||
|
|
|
@ -10,9 +10,6 @@ package org.apache.lucene.queryParser;
|
||||||
*
|
*
|
||||||
* You can modify this class to customize your error reporting
|
* You can modify this class to customize your error reporting
|
||||||
* mechanisms so long as you retain the public fields.
|
* 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 {
|
public class ParseException extends Exception {
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,9 @@ import org.apache.lucene.util.Parameter;
|
||||||
*
|
*
|
||||||
* <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,
|
* <p><b>NOTE</b>: there is a new QueryParser in contrib, which matches
|
||||||
* currently located in contrib: org.apache.lucene.queryParser.original.OriginalQueryParserHelper
|
* the same syntax as this class, but is more modular,
|
||||||
|
* enabling substantial customization to how a query is created.
|
||||||
*/
|
*/
|
||||||
public class QueryParser implements QueryParserConstants {
|
public class QueryParser implements QueryParserConstants {
|
||||||
|
|
||||||
|
@ -1590,6 +1591,16 @@ public class QueryParser implements QueryParserConstants {
|
||||||
finally { jj_save(0, xla); }
|
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() {
|
private boolean jj_3R_3() {
|
||||||
if (jj_scan_token(STAR)) return true;
|
if (jj_scan_token(STAR)) return true;
|
||||||
if (jj_scan_token(COLON)) return true;
|
if (jj_scan_token(COLON)) return true;
|
||||||
|
@ -1602,16 +1613,6 @@ public class QueryParser implements QueryParserConstants {
|
||||||
return false;
|
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. */
|
/** Generated Token Manager. */
|
||||||
public QueryParserTokenManager token_source;
|
public QueryParserTokenManager token_source;
|
||||||
/** Current token. */
|
/** Current token. */
|
||||||
|
|
|
@ -122,9 +122,9 @@ import org.apache.lucene.util.Parameter;
|
||||||
*
|
*
|
||||||
* <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,
|
* <p><b>NOTE</b>: there is a new QueryParser in contrib, which matches
|
||||||
* currently located in contrib: org.apache.lucene.queryParser.original.LuceneQueryParserHelper
|
* the same syntax as this class, but is more modular,
|
||||||
*
|
* enabling substantial customization to how a query is created.
|
||||||
*/
|
*/
|
||||||
public class QueryParser {
|
public class QueryParser {
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,6 @@ package org.apache.lucene.queryParser;
|
||||||
/**
|
/**
|
||||||
* Token literal values and constants.
|
* Token literal values and constants.
|
||||||
* Generated by org.javacc.parser.OtherFilesGen#start()
|
* 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 {
|
public interface QueryParserConstants {
|
||||||
|
|
||||||
|
|
|
@ -34,11 +34,7 @@ import org.apache.lucene.search.TermQuery;
|
||||||
import org.apache.lucene.search.WildcardQuery;
|
import org.apache.lucene.search.WildcardQuery;
|
||||||
import org.apache.lucene.util.Parameter;
|
import org.apache.lucene.util.Parameter;
|
||||||
|
|
||||||
/** Token Manager.
|
/** 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
|
|
||||||
*/
|
|
||||||
public class QueryParserTokenManager implements QueryParserConstants
|
public class QueryParserTokenManager implements QueryParserConstants
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,6 @@ package org.apache.lucene.queryParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the input token stream.
|
* 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 {
|
public class Token {
|
||||||
|
|
|
@ -2,12 +2,7 @@
|
||||||
/* JavaCCOptions: */
|
/* JavaCCOptions: */
|
||||||
package org.apache.lucene.queryParser;
|
package org.apache.lucene.queryParser;
|
||||||
|
|
||||||
/** Token Manager Error.
|
/** 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class TokenMgrError extends Error
|
public class TokenMgrError extends Error
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
NOTE: Please look into lucene contrib/queryparser for the new flexible queryparser api.
|
|
||||||
|
|
||||||
A simple query parser implemented with JavaCC.
|
A simple query parser implemented with JavaCC.
|
||||||
<p>Note that JavaCC defines lots of public classes, methods and fields
|
<p>Note that JavaCC defines lots of public classes, methods and fields
|
||||||
|
@ -28,5 +27,9 @@ that do not need to be public. These clutter the documentation.
|
||||||
Sorry.
|
Sorry.
|
||||||
<p>Note that because JavaCC defines a class named <tt>Token</tt>, <tt>org.apache.lucene.analysis.Token</tt>
|
<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.
|
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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue