org.apache.lucene.search

## Class RandomApproximationQuery

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

- All Implemented Interfaces:
    Cloneable

      public class RandomApproximationQuery
      extends Query

  A `Query` that adds random approximations to its scorers.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RandomApproximationQuery(Query query, Random random)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Weight` | `createWeight(IndexSearcher searcher, boolean needsScores)`
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `Query` | `rewrite(IndexReader reader)`
    `String` | `toString(String field)`

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

      `clone, getBoost, setBoost, toString`

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

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

- - ### Constructor Detail

    - #### RandomApproximationQuery

          public RandomApproximationQuery(Query query,
                                  Random random)

  - ### Method Detail

    - #### rewrite

          public Query rewrite(IndexReader reader)
                        throws IOException

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

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Query`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Query`

    - #### toString

          public String toString(String field)

      Specified by:
        `toString` in class `Query`

    - #### createWeight

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

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

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