org.apache.lucene.search

## Class CheckHits.MatchesAsserter

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

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

      public static class CheckHits.MatchesAsserter
      extends SimpleCollector

  Asserts that the `Matches` from a query is non-null whenever the document its created for is a hit.

  Also checks that the previous non-matching document has a `null` `Matches`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MatchesAsserter(Query query, IndexSearcher searcher)`

  - ### 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()`

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

      `getLeafCollector, setScorer`

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

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

- - ### Constructor Detail

    - #### MatchesAsserter

          public MatchesAsserter(Query query,
                                 IndexSearcher searcher)
                          throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### doSetNextReader

          protected void doSetNextReader(LeafReaderContext context)
                                  throws IOException

      Overrides:
        `doSetNextReader` 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`

    - #### needsScores

          public boolean needsScores()

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