org.apache.lucene.queryparser.flexible.standard.nodes

## Class LegacyNumericQueryNode

- java.lang.Object
- - org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl
  - - org.apache.lucene.queryparser.flexible.standard.nodes.LegacyNumericQueryNode

- All Implemented Interfaces:
    Cloneable, FieldableNode, FieldValuePairQueryNode<Number>, QueryNode, ValueQueryNode<Number>

  Deprecated.
  Index with Points instead and use `PointQueryNode` instead.

      @Deprecated
      public class LegacyNumericQueryNode
      extends QueryNodeImpl
      implements FieldValuePairQueryNode<Number>

  This query node represents a field query that holds a numeric value. It is similar to `FieldQueryNode`, however the `getValue()` returns a `Number`.
  See Also:
    `LegacyNumericConfig`

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl

      `PLAINTEXT_FIELD_NAME, toQueryStringIgnoreFields`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LegacyNumericQueryNode(CharSequence field, Number value, NumberFormat numberFormat)` Deprecated. Creates a `LegacyNumericQueryNode` object using the given field, `Number` value and `NumberFormat` used to convert the value to `String`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `CharSequence` | `getField()` Deprecated. Returns the field associated with this node.
    `NumberFormat` | `getNumberFormat()` Deprecated. Returns the `NumberFormat` used to convert the value to `String`.
    `protected CharSequence` | `getTermEscaped(EscapeQuerySyntax escaper)` Deprecated. This method is used to get the value converted to `String` and escaped using the given `EscapeQuerySyntax`.
    `Number` | `getValue()` Deprecated. Returns the numeric value as `Number`.
    `void` | `setField(CharSequence fieldName)` Deprecated. Sets the field associated with this node.
    `void` | `setNumberFormat(NumberFormat format)` Deprecated. Sets the `NumberFormat` used to convert the value to `String`.
    `void` | `setValue(Number value)` Deprecated. Sets the numeric value.
    `CharSequence` | `toQueryString(EscapeQuerySyntax escapeSyntaxParser)` Deprecated. convert to a query string understood by the query parser
    `String` | `toString()` Deprecated. Every implementation of this class should return pseudo xml like this: For FieldQueryNode: <field start='1' end='2' field='subject' text='foo'/>

    - ### Methods inherited from class org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl

      `add, add, allocate, clone, cloneTree, containsTag, getChildren, getParent, getTag, getTagMap, isDefaultField, isLeaf, isRoot, removeChildren, removeFromParent, set, setLeaf, setTag, unsetTag`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.lucene.queryparser.flexible.core.nodes.QueryNode

      `add, add, cloneTree, containsTag, getChildren, getParent, getTag, getTagMap, isLeaf, removeChildren, removeFromParent, set, setTag, unsetTag`

- - ### Constructor Detail

    - #### LegacyNumericQueryNode

          public LegacyNumericQueryNode(CharSequence field,
                                        Number value,
                                        NumberFormat numberFormat)

      Deprecated.
      Creates a `LegacyNumericQueryNode` object using the given field, `Number` value and `NumberFormat` used to convert the value to `String`.
      Parameters:
        `field` - the field associated with this query node
        `value` - the value hold by this node
        `numberFormat` - the `NumberFormat` used to convert the value to `String`

  - ### Method Detail

    - #### getField

          public CharSequence getField()

      Deprecated.
      Returns the field associated with this node.
      Specified by:
        `getField` in interface `FieldableNode`
      Returns:
        the field associated with this node

    - #### setField

          public void setField(CharSequence fieldName)

      Deprecated.
      Sets the field associated with this node.
      Specified by:
        `setField` in interface `FieldableNode`
      Parameters:
        `fieldName` - the field associated with this node

    - #### getTermEscaped

          protected CharSequence getTermEscaped(EscapeQuerySyntax escaper)

      Deprecated.
      This method is used to get the value converted to `String` and escaped using the given `EscapeQuerySyntax`.
      Parameters:
        `escaper` - the `EscapeQuerySyntax` used to escape the value `String`
      Returns:
        the value converte to `String` and escaped

    - #### toQueryString

          public CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser)

      Deprecated.
      Description copied from interface: `QueryNode`
      convert to a query string understood by the query parser
      Specified by:
        `toQueryString` in interface `QueryNode`

    - #### setNumberFormat

          public void setNumberFormat(NumberFormat format)

      Deprecated.
      Sets the `NumberFormat` used to convert the value to `String`.
      Parameters:
        `format` - the `NumberFormat` used to convert the value to `String`

    - #### getNumberFormat

          public NumberFormat getNumberFormat()

      Deprecated.
      Returns the `NumberFormat` used to convert the value to `String`.
      Returns:
        the `NumberFormat` used to convert the value to `String`

    - #### getValue

          public Number getValue()

      Deprecated.
      Returns the numeric value as `Number`.
      Specified by:
        `getValue` in interface `ValueQueryNode<Number>`
      Returns:
        the numeric value

    - #### setValue

          public void setValue(Number value)

      Deprecated.
      Sets the numeric value.
      Specified by:
        `setValue` in interface `ValueQueryNode<Number>`
      Parameters:
        `value` - the numeric value

    - #### toString

          public String toString()

      Deprecated.
      Description copied from class: `QueryNodeImpl`
      Every implementation of this class should return pseudo xml like this: For FieldQueryNode: <field start='1' end='2' field='subject' text='foo'/>
      Specified by:
        `toString` in interface `QueryNode`
      Overrides:
        `toString` in class `QueryNodeImpl`
      See Also:
        `QueryNode.toString()`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.