org.apache.lucene.search

## Class DocValuesNumbersQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.search.DocValuesNumbersQuery

-     public class DocValuesNumbersQuery
      extends Query

  Like `DocValuesTermsQuery`, but this query only runs on a long `NumericDocValuesField` or a `SortedNumericDocValuesField`, matching all documents whose value in the specified field is contained in the provided set of long values.

  NOTE: be very careful using this query: it is typically much slower than using `TermsQuery`, but in certain specialized cases may be faster.

  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocValuesNumbersQuery(String field, Collection<Long> numbers)`
    `DocValuesNumbersQuery(String field, Long... numbers)`
    `DocValuesNumbersQuery(String field, long[] numbers)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Weight` | `createWeight(IndexSearcher searcher, boolean needsScores, float boost)`
    `boolean` | `equals(Object other)`
    `String` | `getField()`
    `Set<Long>` | `getNumbers()`
    `int` | `hashCode()`
    `String` | `toString(String defaultField)`

    - ### Methods inherited from class org.apache.lucene.search.Query

      `classHash, rewrite, sameClassAs, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DocValuesNumbersQuery

          public DocValuesNumbersQuery(String field,
                                       long[] numbers)

    - #### DocValuesNumbersQuery

          public DocValuesNumbersQuery(String field,
                                       Collection<Long> numbers)

    - #### DocValuesNumbersQuery

          public DocValuesNumbersQuery(String field,
                                       Long... numbers)

  - ### Method Detail

    - #### equals

          public boolean equals(Object other)

      Specified by:
        `equals` in class `Query`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `Query`

    - #### getField

          public String getField()

    - #### getNumbers

          public Set<Long> getNumbers()

    - #### toString

          public String toString(String defaultField)

      Specified by:
        `toString` in class `Query`

    - #### createWeight

          public Weight createWeight(IndexSearcher searcher,
                                     boolean needsScores,
                                     float boost)
                              throws IOException

      Overrides:
        `createWeight` in class `Query`
      Throws:
        `IOException`

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