org.apache.lucene.search

## Class AssertingIndexSearcher

- java.lang.Object
- - org.apache.lucene.search.IndexSearcher
  - - org.apache.lucene.search.AssertingIndexSearcher

-     public class AssertingIndexSearcher
      extends IndexSearcher

  Helper class that adds some extra checks to ensure correct usage of `IndexSearcher` and `Weight`.

- - ### Nested Class Summary

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

      `IndexSearcher.LeafSlice`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.search.IndexSearcher

      `leafContexts, readerContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AssertingIndexSearcher(Random random, IndexReader r)`
    `AssertingIndexSearcher(Random random, IndexReaderContext context)`
    `AssertingIndexSearcher(Random random, IndexReaderContext context, ExecutorService ex)`
    `AssertingIndexSearcher(Random random, IndexReader r, ExecutorService ex)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Weight` | `createWeight(Query query, boolean needsScores, float boost)`
    `Query` | `rewrite(Query original)`
    `protected void` | `search(List<LeafReaderContext> leaves, Weight weight, Collector collector)`
    `String` | `toString()`

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

      `collectionStatistics, count, createNormalizedWeight, doc, doc, doc, explain, explain, getDefaultQueryCache, getDefaultQueryCachingPolicy, getDefaultSimilarity, getIndexReader, getQueryCache, getQueryCachingPolicy, getSimilarity, getSlices, getTopReaderContext, search, search, search, search, search, searchAfter, searchAfter, searchAfter, setDefaultQueryCache, setDefaultQueryCachingPolicy, setQueryCache, setQueryCachingPolicy, setSimilarity, slices, termStatistics`

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

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

- - ### Constructor Detail

    - #### AssertingIndexSearcher

          public AssertingIndexSearcher(Random random,
                                        IndexReader r)

    - #### AssertingIndexSearcher

          public AssertingIndexSearcher(Random random,
                                        IndexReaderContext context)

    - #### AssertingIndexSearcher

          public AssertingIndexSearcher(Random random,
                                        IndexReader r,
                                        ExecutorService ex)

    - #### AssertingIndexSearcher

          public AssertingIndexSearcher(Random random,
                                        IndexReaderContext context,
                                        ExecutorService ex)

  - ### Method Detail

    - #### createWeight

          public Weight createWeight(Query query,
                                     boolean needsScores,
                                     float boost)
                              throws IOException

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

    - #### rewrite

          public Query rewrite(Query original)
                        throws IOException

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

    - #### search

          protected void search(List<LeafReaderContext> leaves,
                                Weight weight,
                                Collector collector)
                         throws IOException

      Overrides:
        `search` in class `IndexSearcher`
      Throws:
        `IOException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `IndexSearcher`

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