diff --git a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java b/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java
deleted file mode 100644
index f202b0c16ce..00000000000
--- a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.lucene.benchmark.byTask.feeds;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.lucene.benchmark.byTask.utils.Config;
-
-/**
- * A {@link DocMaker} which reads the English Wikipedia dump. Uses
- * {@link EnwikiContentSource} as its content source, regardless if a different
- * content source was defined in the configuration.
- * @deprecated Please use {@link DocMaker} instead, with content.source=EnwikiContentSource
- */
-@Deprecated
-public class EnwikiDocMaker extends DocMaker {
- @Override
- public void setConfig(Config config) {
- super.setConfig(config);
- // Override whatever content source was set in the config
- source = new EnwikiContentSource();
- source.setConfig(config);
- System.out.println("NOTE: EnwikiDocMaker is deprecated; please use DocMaker instead (which is the default if you don't specify doc.maker) with content.source=EnwikiContentSource");
- }
-}
diff --git a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocMaker.java b/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocMaker.java
deleted file mode 100644
index 5f54c0f6646..00000000000
--- a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocMaker.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.lucene.benchmark.byTask.feeds;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.lucene.benchmark.byTask.utils.Config;
-
-/**
- * A DocMaker reading one line at a time as a Document from a single file. This
- * saves IO cost (over DirContentSource) of recursing through a directory and
- * opening a new file for every document. It also re-uses its Document and Field
- * instance to improve indexing speed.
- * The expected format of each line is (arguments are separated by <TAB>):
- * title, date, body. If a line is read in a different format, a
- * {@link RuntimeException} will be thrown. In general, you should use this doc
- * maker with files that were created with
- * {@link org.apache.lucene.benchmark.byTask.tasks.WriteLineDocTask}.
- *
- * Config properties:
- *
- * NOTE: This only works if you do not use field/document boosts in your - * index. - *
- * - * @version $Id$ - * @deprecated Use {@link org.apache.lucene.index.FieldNormModifier} - */ -@Deprecated -public class LengthNormModifier { - - /** - * Command Line Execution method. - * - *- * Usage: LengthNormModifier /path/index package.SimilarityClassName field1 field2 ... - *- */ - public static void main(String[] args) throws IOException { - if (args.length < 3) { - System.err.println("Usage: LengthNormModifier
reSetNorms
- */
- public LengthNormModifier(Directory d, Similarity s) {
- dir = d;
- sim = s;
- }
-
- /**
- * Resets the norms for the specified field.
- *
- * - * Opens a new IndexReader on the Directory given to this instance, - * modifies the norms using the Similarity given to this instance, - * and closes the IndexReader. - *
- * - * @param field the field whose norms should be reset - */ - public void reSetNorms(String field) throws IOException { - String fieldName = StringHelper.intern(field); - int[] termCounts = new int[0]; - - IndexReader reader = IndexReader.open(dir, false); - try { - - termCounts = new int[reader.maxDoc()]; - Bits delDocs = MultiFields.getDeletedDocs(reader); - DocsEnum docs = null; - - Terms terms = MultiFields.getTerms(reader, field); - if (terms != null) { - TermsEnum termsEnum = terms.iterator(); - while(termsEnum.next() != null) { - docs = termsEnum.docs(delDocs, docs); - int doc; - while ((doc = docs.nextDoc()) != DocsEnum.NO_MORE_DOCS) { - termCounts[doc] += docs.freq(); - } - } - } - - for (int d = 0; d < termCounts.length; d++) { - if (!delDocs.get(d)) { - byte norm = Similarity.encodeNorm(sim.lengthNorm(fieldName, termCounts[d])); - reader.setNorm(d, fieldName, norm); - } - } - } finally { - reader.close(); - } - } - -} diff --git a/lucene/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java b/lucene/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java index a514c380d7f..2e6868e5202 100644 --- a/lucene/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java +++ b/lucene/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java @@ -106,27 +106,15 @@ public class BooleanFilter extends Filter } if (res !=null) - return finalResult(res, reader.maxDoc()); + return res; return DocIdSet.EMPTY_DOCIDSET; } - /** Provide a SortedVIntList when it is definitely smaller - * than an OpenBitSet. - * @deprecated Either use CachingWrapperFilter, or - * switch to a different DocIdSet implementation yourself. - * This method will be removed in Lucene 4.0 - */ - @Deprecated - protected final DocIdSet finalResult(OpenBitSetDISI result, int maxDocs) { - return result; - } - /** * Adds a new FilterClause to the Boolean Filter container * @param filterClause A FilterClause object containing a Filter and an Occur parameter */ - public void add(FilterClause filterClause) { if (filterClause.getOccur().equals(Occur.MUST)) { diff --git a/lucene/contrib/queries/src/java/org/apache/lucene/search/ChainedFilter.java b/lucene/contrib/queries/src/java/org/apache/lucene/search/ChainedFilter.java index f06d0e23a06..e95b50660d8 100644 --- a/lucene/contrib/queries/src/java/org/apache/lucene/search/ChainedFilter.java +++ b/lucene/contrib/queries/src/java/org/apache/lucene/search/ChainedFilter.java @@ -149,18 +149,6 @@ public class ChainedFilter extends Filter return result; } - /** Provide a SortedVIntList when it is definitely - * smaller than an OpenBitSet - * @deprecated Either use CachingWrapperFilter, or - * switch to a different DocIdSet implementation yourself. - * This method will be removed in Lucene 4.0 - **/ - @Deprecated - protected final DocIdSet finalResult(OpenBitSetDISI result, int maxDocs) { - return result; - } - - /** * Delegates to each filter in the chain. * @param reader IndexReader @@ -175,7 +163,7 @@ public class ChainedFilter extends Filter { doChain(result, logic, chain[index[0]].getDocIdSet(reader)); } - return finalResult(result, reader.maxDoc()); + return result; } /** @@ -195,7 +183,7 @@ public class ChainedFilter extends Filter { doChain(result, logic[index[0]], chain[index[0]].getDocIdSet(reader)); } - return finalResult(result, reader.maxDoc()); + return result; } @Override diff --git a/lucene/contrib/queries/src/java/org/apache/lucene/search/regex/SpanRegexQuery.java b/lucene/contrib/queries/src/java/org/apache/lucene/search/regex/SpanRegexQuery.java deleted file mode 100644 index 818a9497deb..00000000000 --- a/lucene/contrib/queries/src/java/org/apache/lucene/search/regex/SpanRegexQuery.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.apache.lucene.search.regex; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.apache.lucene.index.Term; -import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper; - -/** - * A SpanQuery version of {@link RegexQuery} allowing regular expression - * queries to be nested within other SpanQuery subclasses. - * @deprecated Usenew SpanMultiTermQueryWrapper<RegexQuery>(new RegexQuery())
instead.
- * This query will be removed in Lucene 4.0
- */
-@Deprecated
-public class SpanRegexQuery extends SpanMultiTermQueryWrapper
- * It will, when parse(String query) is called, construct a query like this
- * (assuming the query consists of two terms and you specify the two fields
- * title
and body
):
- *
- * (title:term1 body:term1) (title:term2 body:term2)
- *
- *
- * - * When setDefaultOperator(AND_OPERATOR) is set, the result will be: - *
- * - *
- * +(title:term1 body:term1) +(title:term2 body:term2)
- *
- *
- * - * When you pass a boost (title=>5 body=>10) you can get - *
- * - *
- * +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0)
- *
- *
- * - * In other words, all the query's terms must appear, but it doesn't matter in - * what fields they appear. - *
- */ -public MultiFieldQueryParserWrapper(String[] fields, Analyzer analyzer, Map
- * It will, when parse(String query) is called, construct a query like this
- * (assuming the query consists of two terms and you specify the two fields
- * title
and body
):
- *
- * (title:term1 body:term1) (title:term2 body:term2)
- *
- *
- * - * When setDefaultOperator(AND_OPERATOR) is set, the result will be: - *
- * - *
- * +(title:term1 body:term1) +(title:term2 body:term2)
- *
- *
- * - * In other words, all the query's terms must appear, but it doesn't matter in - * what fields they appear. - *
- */ - public MultiFieldQueryParserWrapper(String[] fields, Analyzer analyzer) { - super(null, analyzer); - - StandardQueryParser qpHelper = getQueryParserHelper(); - qpHelper.setAnalyzer(analyzer); - - qpHelper.setMultiFields(fields); - } - - /** - * Parses a query which searches on the fields specified. - *- * If x fields are specified, this effectively constructs: - * - *
- * <code> - * (field1:query1) (field2:query2) (field3:query3)...(fieldx:queryx) - * </code> - *- * - * @param queries - * Queries strings to parse - * @param fields - * Fields to search on - * @param analyzer - * Analyzer to use - * @throws ParseException - * if query parsing fails - * @throws IllegalArgumentException - * if the length of the queries array differs from the length of the - * fields array - */ - public static Query parse(String[] queries, String[] fields, Analyzer analyzer) - throws ParseException { - if (queries.length != fields.length) - throw new IllegalArgumentException("queries.length != fields.length"); - BooleanQuery bQuery = new BooleanQuery(); - for (int i = 0; i < fields.length; i++) { - QueryParserWrapper qp = new QueryParserWrapper(fields[i], analyzer); - Query q = qp.parse(queries[i]); - if (q != null && // q never null, just being defensive - (!(q instanceof BooleanQuery) || ((BooleanQuery) q).getClauses().length > 0)) { - bQuery.add(q, BooleanClause.Occur.SHOULD); - } - } - return bQuery; - } - - /** - * Parses a query, searching on the fields specified. Use this if you need to - * specify certain fields as required, and others as prohibited. - *
- * - *
- * Usage: - * <code> - * String[] fields = {"filename", "contents", "description"}; - * BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, - * BooleanClause.Occur.MUST, - * BooleanClause.Occur.MUST_NOT}; - * MultiFieldQueryParser.parse("query", fields, flags, analyzer); - * </code> - *- *
- * The code above would construct a query: - * - *
- * <code> - * (filename:query) +(contents:query) -(description:query) - * </code> - *- * - * @param query - * Query string to parse - * @param fields - * Fields to search on - * @param flags - * Flags describing the fields - * @param analyzer - * Analyzer to use - * @throws ParseException - * if query parsing fails - * @throws IllegalArgumentException - * if the length of the fields array differs from the length of the - * flags array - */ - public static Query parse(String query, String[] fields, - BooleanClause.Occur[] flags, Analyzer analyzer) throws ParseException { - if (fields.length != flags.length) - throw new IllegalArgumentException("fields.length != flags.length"); - BooleanQuery bQuery = new BooleanQuery(); - for (int i = 0; i < fields.length; i++) { - QueryParserWrapper qp = new QueryParserWrapper(fields[i], analyzer); - Query q = qp.parse(query); - if (q != null && // q never null, just being defensive - (!(q instanceof BooleanQuery) || ((BooleanQuery) q).getClauses().length > 0)) { - bQuery.add(q, flags[i]); - } - } - return bQuery; - } - - /** - * Parses a query, searching on the fields specified. Use this if you need to - * specify certain fields as required, and others as prohibited. - *
- * - *
- * Usage: - * <code> - * String[] query = {"query1", "query2", "query3"}; - * String[] fields = {"filename", "contents", "description"}; - * BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, - * BooleanClause.Occur.MUST, - * BooleanClause.Occur.MUST_NOT}; - * MultiFieldQueryParser.parse(query, fields, flags, analyzer); - * </code> - *- *
- * The code above would construct a query: - * - *
- * <code> - * (filename:query1) +(contents:query2) -(description:query3) - * </code> - *- * - * @param queries - * Queries string to parse - * @param fields - * Fields to search on - * @param flags - * Flags describing the fields - * @param analyzer - * Analyzer to use - * @throws ParseException - * if query parsing fails - * @throws IllegalArgumentException - * if the length of the queries, fields, and flags array differ - */ - public static Query parse(String[] queries, String[] fields, - BooleanClause.Occur[] flags, Analyzer analyzer) throws ParseException { - if (!(queries.length == fields.length && queries.length == flags.length)) - throw new IllegalArgumentException( - "queries, fields, and flags array have have different length"); - BooleanQuery bQuery = new BooleanQuery(); - for (int i = 0; i < fields.length; i++) { - QueryParserWrapper qp = new QueryParserWrapper(fields[i], analyzer); - Query q = qp.parse(queries[i]); - if (q != null && // q never null, just being defensive - (!(q instanceof BooleanQuery) || ((BooleanQuery) q).getClauses().length > 0)) { - bQuery.add(q, flags[i]); - } - } - return bQuery; - } - -} diff --git a/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserWrapper.java b/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserWrapper.java deleted file mode 100644 index 839cfa3aae5..00000000000 --- a/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserWrapper.java +++ /dev/null @@ -1,491 +0,0 @@ -package org.apache.lucene.queryParser.standard; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.text.Collator; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.document.DateTools; -import org.apache.lucene.document.DateTools.Resolution; -import org.apache.lucene.queryParser.ParseException; -import org.apache.lucene.queryParser.QueryParser; -import org.apache.lucene.queryParser.core.QueryNodeException; -import org.apache.lucene.queryParser.core.config.FieldConfig; -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.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.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.MultiTermRewriteMethodAttribute; -import org.apache.lucene.queryParser.standard.config.PositionIncrementsAttribute; -import org.apache.lucene.queryParser.standard.config.RangeCollatorAttribute; -import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler; -import org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser; -import org.apache.lucene.queryParser.standard.processors.StandardQueryNodeProcessorPipeline; -import org.apache.lucene.search.BooleanClause; -import org.apache.lucene.search.FuzzyQuery; -import org.apache.lucene.search.MultiTermQuery; -import org.apache.lucene.search.Query; - -/** - * This class performs the query parsing using the new query parser - * implementation, but keeps the old {@link QueryParser} API.
\
.
- */
- public static String escape(String s) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < s.length(); i++) {
- char c = s.charAt(i);
- // These characters are part of the query syntax and must be escaped
- if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')'
- || c == ':' || c == '^' || c == '[' || c == ']' || c == '\"'
- || c == '{' || c == '}' || c == '~' || c == '*' || c == '?'
- || c == '|' || c == '&') {
- sb.append('\\');
- }
- sb.append(c);
- }
- return sb.toString();
- }
-
- private SyntaxParser syntaxParser = new StandardSyntaxParser();
-
- private StandardQueryConfigHandler config;
-
- private StandardQueryParser qpHelper;
-
- private QueryNodeProcessor processorPipeline;
-
- private StandardQueryBuilder builder = new StandardQueryTreeBuilder();
-
- private String defaultField;
-
- public QueryParserWrapper(String defaultField, Analyzer analyzer) {
- this.defaultField = defaultField;
-
- this.qpHelper = new StandardQueryParser();
-
- this.config = (StandardQueryConfigHandler) qpHelper.getQueryConfigHandler();
-
- this.qpHelper.setAnalyzer(analyzer);
-
- this.processorPipeline = new StandardQueryNodeProcessorPipeline(this.config);
-
- }
-
- StandardQueryParser getQueryParserHelper() {
- return qpHelper;
- }
-
- public String getField() {
- return this.defaultField;
- }
-
- public Analyzer getAnalyzer() {
-
- if (this.config != null
- && this.config.hasAttribute(AnalyzerAttribute.class)) {
-
- return this.config.getAttribute(AnalyzerAttribute.class).getAnalyzer();
-
- }
-
- return null;
-
- }
-
- /**
- * 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(StandardQueryBuilder builder) {
- this.builder = builder;
- }
-
- /**
- * Sets the {@link QueryNodeProcessor} used to process the query node tree
- * generated by the
- * {@link org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser}.
- *
- * @param processor the processor
- */
- public void setQueryProcessor(QueryNodeProcessor processor) {
- this.processorPipeline = processor;
- this.processorPipeline.setQueryConfigHandler(this.config);
-
- }
-
- /**
- * Sets the {@link QueryConfigHandler} used by the {@link QueryNodeProcessor}
- * set to this object.
- *
- * @param queryConfig the query config handler
- */
- public void setQueryConfig(StandardQueryConfigHandler queryConfig) {
- this.config = queryConfig;
-
- if (this.processorPipeline != null) {
- this.processorPipeline.setQueryConfigHandler(this.config);
- }
-
- }
-
- /**
- * Returns the query config handler used by this query parser
- *
- * @return the query config handler
- */
- public QueryConfigHandler getQueryConfigHandler() {
- return this.config;
- }
-
- /**
- * Returns {@link QueryNodeProcessor} used to process the query node tree
- * generated by the
- * {@link org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser}.
- *
- * @return the query processor
- */
- public QueryNodeProcessor getQueryProcessor() {
- return this.processorPipeline;
- }
-
- public ParseException generateParseException() {
- return null;
- }
-
- public boolean getAllowLeadingWildcard() {
-
- if (this.config != null
- && this.config.hasAttribute(AllowLeadingWildcardAttribute.class)) {
-
- return this.config.getAttribute(AllowLeadingWildcardAttribute.class)
- .isAllowLeadingWildcard();
-
- }
-
- return false;
-
- }
-
- public MultiTermQuery.RewriteMethod getMultiTermRewriteMethod() {
-
- if (this.config != null
- && this.config.hasAttribute(MultiTermRewriteMethodAttribute.class)) {
-
- return this.config.getAttribute(MultiTermRewriteMethodAttribute.class)
- .getMultiTermRewriteMethod();
-
- }
-
- return MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT;
-
- }
-
- public Resolution getDateResolution(String fieldName) {
-
- if (this.config != null) {
- FieldConfig fieldConfig = this.config.getFieldConfig(fieldName);
-
- if (fieldConfig != null) {
-
- if (this.config.hasAttribute(DateResolutionAttribute.class)) {
-
- return this.config.getAttribute(DateResolutionAttribute.class)
- .getDateResolution();
-
- }
-
- }
-
- }
-
- return null;
-
- }
-
- public boolean getEnablePositionIncrements() {
-
- if (this.config != null
- && this.config.hasAttribute(PositionIncrementsAttribute.class)) {
-
- return this.config.getAttribute(PositionIncrementsAttribute.class)
- .isPositionIncrementsEnabled();
-
- }
-
- return false;
-
- }
-
- public float getFuzzyMinSim() {
- return FuzzyQuery.defaultMinSimilarity;
- }
-
- public int getFuzzyPrefixLength() {
- return FuzzyQuery.defaultPrefixLength;
- }
-
- public Locale getLocale() {
-
- if (this.config != null && this.config.hasAttribute(LocaleAttribute.class)) {
- return this.config.getAttribute(LocaleAttribute.class).getLocale();
- }
-
- return Locale.getDefault();
-
- }
-
- public boolean getLowercaseExpandedTerms() {
-
- if (this.config != null
- && this.config.hasAttribute(LowercaseExpandedTermsAttribute.class)) {
-
- return this.config.getAttribute(LowercaseExpandedTermsAttribute.class)
- .isLowercaseExpandedTerms();
-
- }
-
- return true;
-
- }
-
- public int getPhraseSlop() {
-
- if (this.config != null
- && this.config.hasAttribute(AllowLeadingWildcardAttribute.class)) {
-
- return this.config.getAttribute(DefaultPhraseSlopAttribute.class)
- .getDefaultPhraseSlop();
-
- }
-
- return 0;
-
- }
-
- public Collator getRangeCollator() {
-
- if (this.config != null
- && this.config.hasAttribute(RangeCollatorAttribute.class)) {
-
- return this.config.getAttribute(RangeCollatorAttribute.class)
- .getRangeCollator();
-
- }
-
- return null;
-
- }
-
- public boolean getUseOldRangeQuery() {
- if (getMultiTermRewriteMethod() == MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE) {
- return true;
- } else {
- return false;
- }
- }
-
- public Query parse(String query) throws ParseException {
-
- try {
- QueryNode queryTree = this.syntaxParser.parse(query, getField());
- queryTree = this.processorPipeline.process(queryTree);
- return this.builder.build(queryTree);
-
- } catch (QueryNodeException e) {
- throw new ParseException("parse exception");
- }
-
- }
-
- public void setAllowLeadingWildcard(boolean allowLeadingWildcard) {
- this.qpHelper.setAllowLeadingWildcard(allowLeadingWildcard);
- }
-
- public void setMultiTermRewriteMethod(MultiTermQuery.RewriteMethod method) {
- this.qpHelper.setMultiTermRewriteMethod(method);
- }
-
- public void setDateResolution(Resolution dateResolution) {
- this.qpHelper.setDateResolution(dateResolution);
- }
-
- private Map-There are 2 wrapper classes that extends QueryParser and MultiFieldQueryParser. -The classes implement internally the new query parser structure. These 2 -classes are deprecated and should only be used when there is a need to use the -old query parser interface. -
-