Apache Lucene open-source search software
LUCENE-1486: Move ComplexPhraseQueryParser to contrib
Mark Robert Miller5aaf5b01672a
diff --git a/CHANGES.txt b/CHANGES.txtindex a48bd03ff51..66c10fd33b2 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -621,18 +621,12 @@ New featuresAll standard parsers now also implement Serializable and enforcetheir singleton status. (Uwe Schindler, Mike McCandless)-31. LUCENE-1486: Added ComplexPhraseQueryParser, an extension of QueryParser- that allows a subset of the Lucene query language to be embedded in- PhraseQuerys. Wildcard, Range, and Fuzzy queries, as well as limited- boolean logic, can be used within quote operators with this parser, ie:- "(jo* -john) smyth~". (Mark Harwood via Mark Miller)--32. LUCENE-1741: User configureable maximum chunk size in MMapDirectory.+31. LUCENE-1741: User configureable maximum chunk size in MMapDirectory.On 32 bit platforms, the address space can be very fragmented, soone big ByteBuffer for the whole file may not fit into address space.(Eks Dev via Uwe Schindler)-33. LUCENE-1644: Enable 4 rewrite modes for queries deriving from+32. LUCENE-1644: Enable 4 rewrite modes for queries deriving fromMultiTermQuery (WildcardQuery, PrefixQuery, TermRangeQuery,NumericRangeQuery): CONSTANT_SCORE_FILTER_REWRITE first creates afilter and then assigns constant score (boost) to docs;@@ -642,7 +636,7 @@ New featuresCONSTANT_SCORE_AUTO_REWRITE tries to pick the most performantconstant-score rewrite method. (Mike McCandless)-34. LUCENE-1448: Added TokenStream.end(), to perform end-of-stream+33. LUCENE-1448: Added TokenStream.end(), to perform end-of-streamoperations. This is currently used to fix offset problems whenmultiple fields with the same name are added to a document.(Mike McCandless, Mark Miller, Michael Busch)diff --git a/contrib/CHANGES.txt b/contrib/CHANGES.txtindex f8a1ec780f6..94e6d842e33 100644--- a/contrib/CHANGES.txt+++ b/contrib/CHANGES.txt@@ -106,6 +106,13 @@ New features3.0 and will then replace the current core QueryParser, whichhas been deprecated with this patch.(Luis Alves and Adriano Campos via Michael Busch)++13. LUCENE-1486: Added ComplexPhraseQueryParser, an extension of QueryParser+ that allows a subset of the Lucene query language to be embedded in+ PhraseQuerys. Wildcard, Range, and Fuzzy queries, as well as limited+ boolean logic, can be used within quote operators with this parser, ie:+ "(jo* -john) smyth~". (Mark Harwood via Mark Miller)+Optimizationsdiff --git a/src/java/org/apache/lucene/queryParser/ComplexPhraseQueryParser.java b/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/complexPhrase/ComplexPhraseQueryParser.javasimilarity index 98%rename from src/java/org/apache/lucene/queryParser/ComplexPhraseQueryParser.javarename to contrib/miscellaneous/src/java/org/apache/lucene/queryParser/complexPhrase/ComplexPhraseQueryParser.javaindex f7c5dc1b8df..9db2b2fde51 100644--- a/src/java/org/apache/lucene/queryParser/ComplexPhraseQueryParser.java+++ b/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/complexPhrase/ComplexPhraseQueryParser.java@@ -1,4 +1,4 @@-package org.apache.lucene.queryParser;+package org.apache.lucene.queryParser.complexPhrase;/*** Licensed to the Apache Software Foundation (ASF) under one or more@@ -25,11 +25,13 @@ import java.util.List;import org.apache.lucene.analysis.Analyzer;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.Term;+import org.apache.lucene.queryParser.ParseException;+import org.apache.lucene.queryParser.QueryParser;import org.apache.lucene.search.BooleanClause;import org.apache.lucene.search.BooleanQuery;+import org.apache.lucene.search.MultiTermQuery;import org.apache.lucene.search.Query;import org.apache.lucene.search.TermQuery;-import org.apache.lucene.search.MultiTermQuery;import org.apache.lucene.search.TermRangeQuery;import org.apache.lucene.search.spans.SpanNearQuery;import org.apache.lucene.search.spans.SpanNotQuery;@@ -54,8 +56,8 @@ import org.apache.lucene.search.spans.SpanTermQuery;* currently simply feeds all phrase content through an analyzer to select* phrase terms - any "special" syntax such as * ~ * etc are not given special* status- *- * @deprecated use new the flexible query parser instead+ *+ **/public class ComplexPhraseQueryParser extends QueryParser {private ArrayList/*<ComplexPhraseQuery>*/complexPhrases = null;diff --git a/src/test/org/apache/lucene/queryParser/TestComplexPhraseQuery.java b/contrib/miscellaneous/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.javasimilarity index 97%rename from src/test/org/apache/lucene/queryParser/TestComplexPhraseQuery.javarename to contrib/miscellaneous/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.javaindex b112edd75a4..c5f75fccc36 100644--- a/src/test/org/apache/lucene/queryParser/TestComplexPhraseQuery.java+++ b/contrib/miscellaneous/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.java@@ -1,4 +1,4 @@-package org.apache.lucene.queryParser;+package org.apache.lucene.queryParser.complexPhrase;/*** Licensed to the Apache Software Foundation (ASF) under one or more@@ -27,6 +27,7 @@ import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apache.lucene.index.IndexWriter;import org.apache.lucene.index.IndexWriter.MaxFieldLength;+import org.apache.lucene.queryParser.QueryParser;import org.apache.lucene.search.IndexSearcher;import org.apache.lucene.search.Query;import org.apache.lucene.search.ScoreDoc;