Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/FieldValuePairQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/FieldValuePairQueryNode.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/FieldValuePairQueryNode.java (working copy) @@ -17,6 +17,14 @@ * limitations under the License. */ -public interface FieldValuePairQueryNode extends FieldableNode, ValueQueryNode { +/** + * This interface should be implemented by {@link QueryNode} that holds a field + * and an arbitrary value. + * + * @see FieldableNode + * @see ValueQueryNode + */ +public interface FieldValuePairQueryNode extends + FieldableNode, ValueQueryNode { } Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/NumberQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/NumberQueryNode.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/NumberQueryNode.java (working copy) @@ -1,26 +0,0 @@ -package org.apache.lucene.queryparser.flexible.core.nodes; - -/** - * 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. - */ - -public interface NumberQueryNode { - - void setNumber(Number number); - - Number getNumber(); - -} Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ValueQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ValueQueryNode.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ValueQueryNode.java (working copy) @@ -17,6 +17,10 @@ * the License. */ +/** + * This interface should be implemented by {@link QueryNode} that holds an + * arbitrary value. + */ public interface ValueQueryNode extends QueryNode { public void setValue(T value); Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package.html =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package.html (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package.html (working copy) @@ -61,6 +61,7 @@
  • FuzzyQueryNode - fuzzy node
  • ParametricRangeQueryNode - used for parametric field:[low_value TO high_value]
  • ProximityQueryNode - used for proximity search
  • +
  • NumericRangeQueryNode - used for numeric range search
  • TokenizedPhraseQueryNode - used by tokenizers/lemmatizers/analyzers for phrases/autophrases
  • @@ -68,6 +69,7 @@ Leaf Nodes:
    • FieldQueryNode - field/value node
    • +
    • NumericQueryNode - used for numeric search
    • PathQueryNode - {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} object used with path-like queries
    • OpaqueQueryNode - Used as for part of the query that can be parsed by other parsers. schema/value
    • ParametricQueryNode - used for parametric field [>=|<=|=|<|>] value
    • Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/DummyQueryNodeBuilder.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/DummyQueryNodeBuilder.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/DummyQueryNodeBuilder.java (working copy) @@ -18,19 +18,32 @@ */ import org.apache.lucene.queryparser.flexible.core.QueryNodeException; +import org.apache.lucene.queryparser.flexible.core.builders.QueryTreeBuilder; import org.apache.lucene.queryparser.flexible.core.nodes.FieldQueryNode; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.search.TermQuery; /** - * Builds a {@link TermQuery} object from a {@link FieldQueryNode} object. + * This builder does nothing. Commonly used for {@link QueryNode} objects that + * are built by its parent's builder. + * + * @see StandardQueryBuilder + * @see QueryTreeBuilder */ public class DummyQueryNodeBuilder implements StandardQueryBuilder { + /** + * Constructs a {@link DummyQueryNodeBuilder} object. + */ public DummyQueryNodeBuilder() { // empty constructor } + /** + * Always return null. + * + * return null + */ public TermQuery build(QueryNode queryNode) throws QueryNodeException { return null; } Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/NumericRangeQueryNodeBuilder.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/NumericRangeQueryNodeBuilder.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/NumericRangeQueryNodeBuilder.java (working copy) @@ -28,8 +28,17 @@ import org.apache.lucene.queryparser.flexible.standard.nodes.NumericRangeQueryNode; import org.apache.lucene.search.NumericRangeQuery; +/** + * Builds {@link NumericRangeQuery}s out of {@link NumericRangeQueryNode}s. + * + * @see NumericRangeQuery + * @see NumericRangeQueryNode + */ public class NumericRangeQueryNodeBuilder implements StandardQueryBuilder { + /** + * Constructs a {@link NumericRangeQueryNodeBuilder} object. + */ public NumericRangeQueryNodeBuilder() { // empty constructor } Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/NumberDateFormat.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/NumberDateFormat.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/NumberDateFormat.java (working copy) @@ -19,16 +19,27 @@ import java.text.DateFormat; import java.text.FieldPosition; +import java.text.Format; import java.text.NumberFormat; import java.text.ParsePosition; import java.util.Date; +/** + * This {@link Format} parses {@link Long} into date strings and vice-versa. It + * uses the given {@link DateFormat} to parse and format dates, but before, it + * converts {@link Long} to {@link Date} objects or vice-versa. + */ public class NumberDateFormat extends NumberFormat { private static final long serialVersionUID = 964823936071308283L; final private DateFormat dateFormat; + /** + * Constructs a {@link NumberDateFormat} object using the given {@link DateFormat}. + * + * @param dateFormat {@link DateFormat} used to parse and format dates + */ public NumberDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; } Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/NumericConfig.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/NumericConfig.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/NumericConfig.java (working copy) @@ -20,7 +20,15 @@ import java.text.NumberFormat; import org.apache.lucene.document.NumericField; +import org.apache.lucene.search.NumericRangeQuery; +/** + * This class holds the configuration used to parse numeric queries and create + * {@link NumericRangeQuery}s. + * + * @see NumericRangeQuery + * @see NumberFormat + */ public class NumericConfig { private int precisionStep; @@ -28,30 +36,78 @@ private NumberFormat format; private NumericField.DataType type; - - public NumericConfig(int precisionStep, NumberFormat format, NumericField.DataType type) { + + /** + * Constructs a {@link NumericConfig} object. + * + * @param precisionStep + * the precision used to index the numeric values + * @param format + * the {@link NumberFormat} used to parse a {@link String} to + * {@link Number} + * @param type + * the numeric type used to index the numeric values + * + * @see NumericConfig#setPrecisionStep(int) + * @see NumericConfig#setNumberFormat(NumberFormat) + * @see #setType(org.apache.lucene.document.NumericField.DataType) + */ + public NumericConfig(int precisionStep, NumberFormat format, + NumericField.DataType type) { setPrecisionStep(precisionStep); setNumberFormat(format); setType(type); } + /** + * Returns the precision used to index the numeric values + * + * @return the precision used to index the numeric values + * + * @see NumericRangeQuery#getPrecisionStep() + */ public int getPrecisionStep() { return precisionStep; } + /** + * Sets the precision used to index the numeric values + * + * @param precisionStep + * the precision used to index the numeric values + * + * @see NumericRangeQuery#getPrecisionStep() + */ public void setPrecisionStep(int precisionStep) { this.precisionStep = precisionStep; } + /** + * Returns the {@link NumberFormat} used to parse a {@link String} to + * {@link Number} + * + * @return the {@link NumberFormat} used to parse a {@link String} to + * {@link Number} + */ public NumberFormat getNumberFormat() { return format; } + /** + * Returns the numeric type used to index the numeric values + * + * @return the numeric type used to index the numeric values + */ public NumericField.DataType getType() { return type; } - + + /** + * Sets the numeric type used to index the numeric values + * + * @param type the numeric type used to index the numeric values + */ public void setType(NumericField.DataType type) { if (type == null) { @@ -61,7 +117,15 @@ this.type = type; } - + + /** + * Sets the {@link NumberFormat} used to parse a {@link String} to + * {@link Number} + * + * @param format + * the {@link NumberFormat} used to parse a {@link String} to + * {@link Number}, cannot be null + */ public void setNumberFormat(NumberFormat format) { if (format == null) { @@ -81,7 +145,8 @@ NumericConfig other = (NumericConfig) obj; if (this.precisionStep == other.precisionStep - && this.format == other.format) { + && this.type == other.type + && (this.format == other.format || (this.format.equals(other.format)))) { return true; } Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/NumericFieldConfigListener.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/NumericFieldConfigListener.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/NumericFieldConfigListener.java (working copy) @@ -24,10 +24,26 @@ import org.apache.lucene.queryparser.flexible.core.config.QueryConfigHandler; import org.apache.lucene.queryparser.flexible.standard.config.StandardQueryConfigHandler.ConfigurationKeys; +/** + * This listener is used to listen to {@link FieldConfig} requests in + * {@link QueryConfigHandler} and add {@link ConfigurationKeys#NUMERIC_CONFIG} + * based on the {@link ConfigurationKeys#NUMERIC_CONFIG_MAP} set in the + * {@link QueryConfigHandler}. + * + * @see NumericConfig + * @see QueryConfigHandler + * @see ConfigurationKeys#NUMERIC_CONFIG + * @see ConfigurationKeys#NUMERIC_CONFIG_MAP + */ public class NumericFieldConfigListener implements FieldConfigListener { final private QueryConfigHandler config; + /** + * Construcs a {@link NumericFieldConfigListener} object using the given {@link QueryConfigHandler}. + * + * @param config the {@link QueryConfigHandler} it will listen too + */ public NumericFieldConfigListener(QueryConfigHandler config) { if (config == null) { Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/AbstractRangeQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/AbstractRangeQueryNode.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/AbstractRangeQueryNode.java (working copy) @@ -26,16 +26,32 @@ import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax; import org.apache.lucene.queryparser.flexible.core.util.StringUtils; +/** + * This class should be extended by nodes intending to represent range queries. + * + * @param the type of the range query bounds (lower and upper) + */ public abstract class AbstractRangeQueryNode> extends QueryNodeImpl implements FieldableNode { private boolean lowerInclusive, upperInclusive; + /** + * Constructs an {@link AbstractRangeQueryNode}, it should be invoked only by + * its extenders. + */ protected AbstractRangeQueryNode() { setLeaf(false); allocate(); } + /** + * Returns the field associated with this node. + * + * @return the field associated with this node + * + * @see FieldableNode + */ public CharSequence getField() { CharSequence field = null; T lower = getLowerBound(); @@ -52,6 +68,11 @@ } + /** + * Sets the field associated with this node. + * + * @param fieldName the field associated with this node + */ public void setField(CharSequence fieldName) { T lower = getLowerBound(); T upper = getUpperBound(); @@ -66,24 +87,57 @@ } + /** + * Returns the lower bound node. + * + * @return the lower bound node. + */ @SuppressWarnings("unchecked") public T getLowerBound() { return (T) getChildren().get(0); } + /** + * Returns the upper bound node. + * + * @return the upper bound node. + */ @SuppressWarnings("unchecked") public T getUpperBound() { return (T) getChildren().get(1); } + /** + * Returns whether the lower bound is inclusive or exclusive. + * + * @return true if the lower bound is inclusive, otherwise, false + */ public boolean isLowerInclusive() { return lowerInclusive; } + /** + * Returns whether the upper bound is inclusive or exclusive. + * + * @return true if the upper bound is inclusive, otherwise, false + */ public boolean isUpperInclusive() { return upperInclusive; } + /** + * Sets the lower and upper bounds. + * + * @param lower the lower bound, null if lower bound is open + * @param upper the upper bound, null if upper bound is open + * @param lowerInclusive true if the lower bound is inclusive, otherwise, false + * @param upperInclusive true if the upper bound is inclusive, otherwise, false + * + * @see #getLowerBound() + * @see #getUpperBound() + * @see #isLowerInclusive() + * @see #isUpperInclusive() + */ public void setBounds(T lower, T upper, boolean lowerInclusive, boolean upperInclusive) { Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericQueryNode.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericQueryNode.java (working copy) @@ -20,11 +20,20 @@ import java.text.NumberFormat; import java.util.Locale; +import org.apache.lucene.queryparser.flexible.core.nodes.FieldQueryNode; import org.apache.lucene.queryparser.flexible.core.nodes.FieldValuePairQueryNode; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl; import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax; import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax.Type; +import org.apache.lucene.queryparser.flexible.standard.config.NumericConfig; +/** + * This query node represents a field query that holds a numeric value. It is + * similar to {@link FieldQueryNode}, however the {@link #getValue()} returns a + * {@link Number}. + * + * @see NumericConfig + */ public class NumericQueryNode extends QueryNodeImpl implements FieldValuePairQueryNode { @@ -34,6 +43,15 @@ private Number value; + /** + * Creates a {@link NumericQueryNode} object using the given field, + * {@link Number} value and {@link NumberFormat} used to convert the value to + * {@link String}. + * + * @param field the field associated with this query node + * @param value the value hold by this node + * @param numberFormat the {@link NumberFormat} used to convert the value to {@link String} + */ public NumericQueryNode(CharSequence field, Number value, NumberFormat numberFormat) { @@ -45,14 +63,32 @@ } + /** + * Returns the field associated with this node. + * + * @return the field associated with this node + */ public CharSequence getField() { return this.field; } + /** + * Sets the field associated with this node. + * + * @param fieldName the field associated with this node + */ public void setField(CharSequence fieldName) { this.field = fieldName; } + /** + * This method is used to get the value converted to {@link String} and + * escaped using the given {@link EscapeQuerySyntax}. + * + * @param escaper the {@link EscapeQuerySyntax} used to escape the value {@link String} + * + * @return the value converte to {@link String} and escaped + */ protected CharSequence getTermEscaped(EscapeQuerySyntax escaper) { return escaper.escape(NumberFormat.getNumberInstance().format(this.value), Locale.ENGLISH, Type.NORMAL); @@ -66,18 +102,38 @@ } } + /** + * Sets the {@link NumberFormat} used to convert the value to {@link String}. + * + * @param format the {@link NumberFormat} used to convert the value to {@link String} + */ public void setNumberFormat(NumberFormat format) { this.numberFormat = format; } + /** + * Returns the {@link NumberFormat} used to convert the value to {@link String}. + * + * @return the {@link NumberFormat} used to convert the value to {@link String} + */ public NumberFormat getNumberFormat() { return this.numberFormat; } + /** + * Returns the numeric value as {@link Number}. + * + * @return the numeric value + */ public Number getValue() { return value; } + /** + * Sets the numeric value. + * + * @param value the numeric value + */ public void setValue(Number value) { this.value = value; } Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericRangeQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericRangeQueryNode.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericRangeQueryNode.java (working copy) @@ -4,6 +4,7 @@ import org.apache.lucene.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; +import org.apache.lucene.queryparser.flexible.core.nodes.FieldQueryNode; import org.apache.lucene.queryparser.flexible.standard.config.NumericConfig; /** @@ -23,11 +24,30 @@ * the License. */ +/** + * This query node represents a range query composed by {@link NumericQueryNode} + * bounds, which means the bound values are {@link Number}s. + * + * @see NumericQueryNode + * @see AbstractRangeQueryNode + */ public class NumericRangeQueryNode extends AbstractRangeQueryNode { public NumericConfig numericConfig; + /** + * Constructs a {@link NumericRangeQueryNode} object using the given + * {@link NumericQueryNode} as its bounds and {@link NumericConfig}. + * + * @param lower the lower bound + * @param upper the upper bound + * @param lowerInclusive true if the lower bound is inclusive, otherwise, false + * @param upperInclusive true if the upper bound is inclusive, otherwise, false + * @param numericConfig the {@link NumericConfig} that represents associated with the upper and lower bounds + * + * @see #setBounds(NumericQueryNode, NumericQueryNode, boolean, boolean, NumericConfig) + */ public NumericRangeQueryNode(NumericQueryNode lower, NumericQueryNode upper, boolean lowerInclusive, boolean upperInclusive, NumericConfig numericConfig) throws QueryNodeException { setBounds(lower, upper, lowerInclusive, upperInclusive, numericConfig); @@ -52,6 +72,17 @@ } + /** + * Sets the upper and lower bounds of this range query node and the + * {@link NumericConfig} associated with these bounds. + * + * @param lower the lower bound + * @param upper the upper bound + * @param lowerInclusive true if the lower bound is inclusive, otherwise, false + * @param upperInclusive true if the upper bound is inclusive, otherwise, false + * @param numericConfig the {@link NumericConfig} that represents associated with the upper and lower bounds + * + */ public void setBounds(NumericQueryNode lower, NumericQueryNode upper, boolean lowerInclusive, boolean upperInclusive, NumericConfig numericConfig) throws QueryNodeException { @@ -92,6 +123,11 @@ } + /** + * Returns the {@link NumericConfig} associated with the lower and upper bounds. + * + * @return the {@link NumericConfig} associated with the lower and upper bounds + */ public NumericConfig getNumericConfig() { return this.numericConfig; } Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/TermRangeQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/TermRangeQueryNode.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/TermRangeQueryNode.java (working copy) @@ -20,13 +20,23 @@ import org.apache.lucene.queryparser.flexible.core.nodes.FieldQueryNode; /** - * This query node represents a range query. + * This query node represents a range query composed by {@link FieldQueryNode} + * bounds, which means the bound values are strings. * - * @see org.apache.lucene.queryparser.flexible.standard.processors.ParametricRangeQueryNodeProcessor - * @see org.apache.lucene.search.TermRangeQuery + * @see FieldQueryNode + * @see AbstractRangeQueryNode */ public class TermRangeQueryNode extends AbstractRangeQueryNode { + /** + * Constructs a {@link TermRangeQueryNode} object using the given + * {@link FieldQueryNode} as its bounds. + * + * @param lower the lower bound + * @param upper the upper bound + * @param lowerInclusive true if the lower bound is inclusive, otherwise, false + * @param upperInclusive true if the upper bound is inclusive, otherwise, false + */ public TermRangeQueryNode(FieldQueryNode lower, FieldQueryNode upper, boolean lowerInclusive, boolean upperInclusive) { setBounds(lower, upper, lowerInclusive, upperInclusive); Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericQueryNodeProcessor.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericQueryNodeProcessor.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericQueryNodeProcessor.java (working copy) @@ -36,8 +36,31 @@ import org.apache.lucene.queryparser.flexible.standard.nodes.NumericQueryNode; import org.apache.lucene.queryparser.flexible.standard.nodes.NumericRangeQueryNode; +/** + * This processor is used to convert {@link FieldQueryNode}s to + * {@link NumericRangeQueryNode}s. It looks for + * {@link ConfigurationKeys#NUMERIC_CONFIG} set in the {@link FieldConfig} of + * every {@link FieldQueryNode} found. If + * {@link ConfigurationKeys#NUMERIC_CONFIG} is found, it considers that + * {@link FieldQueryNode} to be a numeric query and convert it to + * {@link NumericRangeQueryNode} with upper and lower inclusive and lower and + * upper equals to the value represented by the {@link FieldQueryNode} converted + * to {@link Number}. It means that field:1 is converted to field:[1 TO + * 1].
      + *
      + * Note that {@link ParametricQueryNode}s are ignored, even being a + * {@link FieldQueryNode}. + * + * @see ConfigurationKeys#NUMERIC_CONFIG + * @see FieldQueryNode + * @see NumericConfig + * @see NumericQueryNode + */ public class NumericQueryNodeProcessor extends QueryNodeProcessorImpl { + /** + * Constructs a {@link NumericQueryNodeProcessor} object. + */ public NumericQueryNodeProcessor() { // empty constructor } Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericRangeQueryNodeProcessor.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericRangeQueryNodeProcessor.java (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericRangeQueryNodeProcessor.java (working copy) @@ -27,6 +27,7 @@ import org.apache.lucene.queryparser.flexible.core.config.FieldConfig; import org.apache.lucene.queryparser.flexible.core.config.QueryConfigHandler; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; +import org.apache.lucene.queryparser.flexible.core.nodes.FieldQueryNode; import org.apache.lucene.queryparser.flexible.core.nodes.ParametricQueryNode; import org.apache.lucene.queryparser.flexible.core.nodes.ParametricRangeQueryNode; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; @@ -38,8 +39,25 @@ import org.apache.lucene.queryparser.flexible.standard.nodes.NumericQueryNode; import org.apache.lucene.queryparser.flexible.standard.nodes.NumericRangeQueryNode; +/** + * This processor is used to convert {@link ParametricRangeQueryNode}s to + * {@link NumericRangeQueryNode}s. It looks for + * {@link ConfigurationKeys#NUMERIC_CONFIG} set in the {@link FieldConfig} of + * every {@link ParametricRangeQueryNode} found. If + * {@link ConfigurationKeys#NUMERIC_CONFIG} is found, it considers that + * {@link ParametricRangeQueryNode} to be a numeric range query and convert it to + * {@link NumericRangeQueryNode}. + * + * @see ConfigurationKeys#NUMERIC_CONFIG + * @see ParametricRangeQueryNode + * @see NumericConfig + * @see NumericRangeQueryNode + */ public class NumericRangeQueryNodeProcessor extends QueryNodeProcessorImpl { + /** + * Constructs an empty {@link NumericRangeQueryNode} object. + */ public NumericRangeQueryNodeProcessor() { // empty constructor } Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package.html =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package.html (revision 1147687) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package.html (working copy) @@ -27,7 +27,7 @@ that modifies the query node tree according to the actual Lucene queries.

      -This processors are already assembled correctly in the StandardQueryNodeProcessorPipeline. +These processors are already assembled correctly in the StandardQueryNodeProcessorPipeline.