org.apache.lucene.search

## Class CheckHits.ExplanationAsserter

- java.lang.Object
- - org.apache.lucene.search.SimpleCollector
  - - org.apache.lucene.search.CheckHits.ExplanationAsserter

- All Implemented Interfaces:
    Collector, LeafCollector
  Enclosing class:
    CheckHits

      public static class CheckHits.ExplanationAsserter
      extends SimpleCollector

  Asserts that the score explanation for every document matching a query corresponds with the true score. NOTE: this HitCollector should only be used with the Query and Searcher specified at when it is constructed.
  See Also:
    `CheckHits.verifyExplanation(java.lang.String, int, float, boolean, org.apache.lucene.search.Explanation)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExplanationAsserter(Query q, String defaultFieldName, IndexSearcher s)` Constructs an instance which does shallow tests on the Explanation
    `ExplanationAsserter(Query q, String defaultFieldName, IndexSearcher s, boolean deep)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `collect(int doc)`
    `protected void` | `doSetNextReader(LeafReaderContext context)`
    `boolean` | `needsScores()`
    `void` | `setScorer(Scorer scorer)`

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

      `getLeafCollector`

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

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

- - ### Constructor Detail

    - #### ExplanationAsserter

          public ExplanationAsserter(Query q,
                                     String defaultFieldName,
                                     IndexSearcher s)

      Constructs an instance which does shallow tests on the Explanation

    - #### ExplanationAsserter

          public ExplanationAsserter(Query q,
                                     String defaultFieldName,
                                     IndexSearcher s,
                                     boolean deep)

  - ### Method Detail

    - #### setScorer

          public void setScorer(Scorer scorer)
                         throws IOException

      Specified by:
        `setScorer` in interface `LeafCollector`
      Overrides:
        `setScorer` in class `SimpleCollector`
      Throws:
        `IOException`

    - #### collect

          public void collect(int doc)
                       throws IOException

      Specified by:
        `collect` in interface `LeafCollector`
      Specified by:
        `collect` in class `SimpleCollector`
      Throws:
        `IOException`

    - #### doSetNextReader

          protected void doSetNextReader(LeafReaderContext context)
                                  throws IOException

      Overrides:
        `doSetNextReader` in class `SimpleCollector`
      Throws:
        `IOException`

    - #### needsScores

          public boolean needsScores()

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