org.apache.lucene.queries.payloads

## Class PayloadNearQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.search.spans.SpanQuery
    - - org.apache.lucene.search.spans.SpanNearQuery
      - - org.apache.lucene.queries.payloads.PayloadNearQuery

- All Implemented Interfaces:
    Cloneable

  Deprecated.
  use `PayloadScoreQuery` to wrap `SpanNearQuery`

      @Deprecated
      public class PayloadNearQuery
      extends SpanNearQuery

  This class is very similar to `SpanNearQuery` except that it factors in the value of the payloads located at each of the positions where the `TermSpans` occurs.

  NOTE: In order to take advantage of this with the default scoring implementation (`DefaultSimilarity`), you must override `ClassicSimilarity.scorePayload(int, int, int, BytesRef)`, which returns 1 by default.

  Payload scores are aggregated using a pluggable `PayloadFunction`.

  See Also:
    `Similarity.SimScorer.computePayloadFactor(int, int, int, BytesRef)`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.search.spans.SpanNearQuery

      `SpanNearQuery.Builder, SpanNearQuery.SpanNearWeight`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `fieldName` Deprecated.
    `protected PayloadFunction` | `function` Deprecated.

    - ### Fields inherited from class org.apache.lucene.search.spans.SpanNearQuery

      `clauses, field, inOrder, slop`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PayloadNearQuery(SpanQuery[] clauses, int slop, boolean inOrder)` Deprecated.
    `PayloadNearQuery(SpanQuery[] clauses, int slop, boolean inOrder, PayloadFunction function)` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PayloadNearQuery` | `clone()` Deprecated.
    `SpanWeight` | `createWeight(IndexSearcher searcher, boolean needsScores)` Deprecated.
    `boolean` | `equals(Object obj)` Deprecated.
    `int` | `hashCode()` Deprecated.
    `String` | `toString(String field)` Deprecated.

    - ### Methods inherited from class org.apache.lucene.search.spans.SpanNearQuery

      `getClauses, getField, getSlop, isInOrder, newOrderedNearQuery, newUnorderedNearQuery, rewrite`

    - ### Methods inherited from class org.apache.lucene.search.spans.SpanQuery

      `getTermContexts, getTermContexts`

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

      `getBoost, setBoost, toString`

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

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

- - ### Field Detail

    - #### fieldName

          protected String fieldName

      Deprecated.

    - #### function

          protected PayloadFunction function

      Deprecated.

  - ### Constructor Detail

    - #### PayloadNearQuery

          public PayloadNearQuery(SpanQuery[] clauses,
                          int slop,
                          boolean inOrder)

      Deprecated.

    - #### PayloadNearQuery

          public PayloadNearQuery(SpanQuery[] clauses,
                          int slop,
                          boolean inOrder,
                          PayloadFunction function)

      Deprecated.

  - ### Method Detail

    - #### createWeight

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

      Deprecated.
      Overrides:
        `createWeight` in class `SpanNearQuery`
      Throws:
        `IOException`

    - #### clone

          public PayloadNearQuery clone()

      Deprecated.
      Overrides:
        `clone` in class `Query`

    - #### toString

          public String toString(String field)

      Deprecated.
      Overrides:
        `toString` in class `SpanNearQuery`

    - #### hashCode

          public int hashCode()

      Deprecated.
      Overrides:
        `hashCode` in class `SpanNearQuery`

    - #### equals

          public boolean equals(Object obj)

      Deprecated.
      Overrides:
        `equals` in class `SpanNearQuery`

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