org.apache.solr.search

## Class SolrIndexSearcher

- java.lang.Object
- - org.apache.lucene.search.IndexSearcher
  - - org.apache.solr.search.SolrIndexSearcher

- All Implemented Interfaces:
    Closeable, AutoCloseable, SolrInfoMBean

      public class SolrIndexSearcher
      extends IndexSearcher
      implements Closeable, SolrInfoMBean

  SolrIndexSearcher adds schema awareness and caching functionality over `IndexSearcher`.
  Since:
    solr 0.9

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SolrIndexSearcher.DocsEnumState`
    `static class` | `SolrIndexSearcher.ProcessedFilter`

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

      `IndexSearcher.LeafSlice`

    - ### Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean

      `SolrInfoMBean.Category`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `enableLazyFieldLoading`
    `static int` | `GET_DOCLIST`
    `static int` | `GET_DOCSET`
    `static int` | `GET_SCORES`
    `static int` | `NO_CHECK_QCACHE`
    `static AtomicLong` | `numCloses`
    `static AtomicLong` | `numOpens`
    `static String` | `STATISTICS_KEY`
    `static String` | `STATS_SOURCE`
    `static int` | `TERMINATE_EARLY`

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

      `leafContexts, leafSlices, readerContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolrIndexSearcher(SolrCore core, String path, IndexSchema schema, SolrIndexConfig config, String name, boolean enableCache, DirectoryFactory directoryFactory)`
    `SolrIndexSearcher(SolrCore core, String path, IndexSchema schema, String name, DirectoryReader r, boolean closeReader, boolean enableCache, boolean reserveDirectory, DirectoryFactory directoryFactory)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cacheDocSet(Query query, DocSet optionalAnswer, boolean mustCache)` Compute and cache the DocSet that matches a query.
    `Object` | `cacheInsert(String cacheName, Object key, Object val)` insert an entry in a generic cache
    `Object` | `cacheLookup(String cacheName, Object key)` lookup an entry in a generic cache
    `void` | `close()` Free's resources associated with this searcher.
    `CollectionStatistics` | `collectionStatistics(String field)`
    `void` | `decorateDocValueFields(SolrDocumentBase doc, int docid, Set<String> fields)` This will fetch and add the docValues fields to a given SolrDocument/SolrInputDocument
    `Document` | `doc(int i)` Retrieve the `Document` instance corresponding to the document id.
    `Document` | `doc(int i, Set<String> fields)` Retrieve the `Document` instance corresponding to the document id.
    `void` | `doc(int n, StoredFieldVisitor visitor)` Visit a document's fields using a `StoredFieldVisitor` This method does not currently add to the Solr document cache.
    `int` | `docFreq(Term term)`
    `Explanation` | `explain(Query query, int doc)`
    `SolrCache` | `getCache(String cacheName)` return the named generic cache
    `SolrInfoMBean.Category` | `getCategory()` Purpose of this Class
    `SolrCore` | `getCore()`
    `String` | `getDescription()` Simple one or two line description
    `DocList` | `getDocList(Query query, DocSet filter, Sort lsort, int offset, int len)` Returns documents matching both `query` and `filter` and sorted by `sort`.
    `DocList` | `getDocList(Query query, List<Query> filterList, Sort lsort, int offset, int len, int flags)` Returns documents matching both `query` and the intersection of the `filterList`, sorted by `sort`.
    `DocList` | `getDocList(Query query, Query filter, Sort lsort, int offset, int len)` Returns documents matching both `query` and `filter` and sorted by `sort`.
    `DocListAndSet` | `getDocListAndSet(Query query, DocSet filter, Sort lsort, int offset, int len)` Returns documents matching both `query` and `filter` and sorted by `sort`.
    `DocListAndSet` | `getDocListAndSet(Query query, DocSet filter, Sort lsort, int offset, int len, int flags)` Returns documents matching both `query` and `filter` and sorted by `sort`.
    `DocListAndSet` | `getDocListAndSet(Query query, List<Query> filterList, Sort lsort, int offset, int len)` Returns documents matching both `query` and the intersection of `filterList`, sorted by `sort`.
    `DocListAndSet` | `getDocListAndSet(Query query, List<Query> filterList, Sort lsort, int offset, int len, int flags)` Returns documents matching both `query` and the intersection of `filterList`, sorted by `sort`.
    `DocListAndSet` | `getDocListAndSet(Query query, Query filter, Sort lsort, int offset, int len)` Returns documents matching both `query` and `filter` and sorted by `sort`.
    `DocListAndSet` | `getDocListAndSet(Query query, Query filter, Sort lsort, int offset, int len, int flags)` Returns documents matching both `query` and `filter` and sorted by `sort`.
    `URL[]` | `getDocs()` Documentation URL list.
    `DocSet` | `getDocSet(List<Query> queries)` Returns the set of document ids matching all queries.
    `DocSet` | `getDocSet(Query query)` Returns the set of document ids matching a query.
    `DocSet` | `getDocSet(Query query, DocSet filter)` Returns the set of document ids matching both the query and the filter.
    `DocSet` | `getDocSet(SolrIndexSearcher.DocsEnumState deState)`
    `BitDocSet` | `getDocSetBits(Query q)`
    `protected DocSet` | `getDocSetNC(Query query, DocSet filter)`
    `Iterable<String>` | `getFieldNames()` Returns a collection of all field names the index reader knows about.
    `SolrCache<String,UnInvertedField>` | `getFieldValueCache()` expert: internal API, subject to change
    `SolrCache<Query,DocSet>` | `getFilterCache()`
    `int` | `getFirstMatch(Term t)` Returns the first document number containing the term `t` Returns -1 if no document was found.
    `IndexFingerprint` | `getIndexFingerprint(long maxVersion)`
    `DirectoryReader` | `getIndexReader()`
    `BitDocSet` | `getLiveDocs()`
    `String` | `getName()` Simple common usage name, e.g.
    `Set<String>` | `getNonStoredDVs(boolean onlyUseDocValuesAsStored)` Returns an unmodifiable set of non-stored docValues field names.
    `Set<String>` | `getNonStoredDVsWithoutCopyTargets()` Returns an unmodifiable set of names of non-stored docValues fields, except those that are targets of a copy field.
    `long` | `getOpenNanoTime()`
    `Date` | `getOpenTimeStamp()`
    `String` | `getPath()`
    `SolrIndexSearcher.ProcessedFilter` | `getProcessedFilter(DocSet setFilter, List<Query> queries)`
    `DirectoryReader` | `getRawReader()` Raw reader (no fieldcaches etc).
    `IndexSchema` | `getSchema()` Direct access to the IndexSchema for use with this searcher
    `LeafReader` | `getSlowAtomicReader()` Not recommended to call this method unless there is some particular reason due to internally calling `SlowCompositeReaderWrapper`.
    `String` | `getSource()` CVS Source, SVN Source, etc
    `NamedList<Object>` | `getStatistics()` Any statistics this instance would like to be publicly available via the Solr Administration interface.
    `Collection<String>` | `getStoredHighlightFieldNames()` Returns a collection of the names of all stored fields which can be highlighted the index reader knows about.
    `String` | `getVersion()` Simple common usage version, e.g.
    `static void` | `initRegenerators(SolrConfig solrConfig)`
    `boolean` | `intersects(DocSet a, SolrIndexSearcher.DocsEnumState deState)`
    `boolean` | `isCachingEnabled()`
    `CollectionStatistics` | `localCollectionStatistics(String field)`
    `TermStatistics` | `localTermStatistics(Term term, TermContext context)`
    `long` | `lookupId(BytesRef idBytes)` lookup the docid by the unique key field, and return the id *within* the leaf reader in the low 32 bits, and the index of the leaf reader in the high 32 bits.
    `int` | `maxDoc()`
    `int` | `numDocs(DocSet a, SolrIndexSearcher.DocsEnumState deState)`
    `int` | `numDocs(Query a, DocSet b)` Returns the number of documents that match both `a` and `b`.
    `int` | `numDocs(Query a, Query b)` Returns the number of documents that match both `a` and `b`.
    `Document[]` | `readDocs(DocList ids)` Takes a list of document IDs, and returns an array of Documents containing all of the stored fields.
    `void` | `readDocs(Document[] docs, DocList ids)` Takes a list of docs (the doc ids actually), and reads them into an array of Documents.
    `void` | `readDocs(Document[] docs, DocList ids, Set<String> fields)` Takes a list of docs (the doc ids actually) and a set of fields to load, and reads them into an array of Documents.
    `void` | `register()` Register sub-objects such as caches
    `QueryResult` | `search(QueryResult qr, QueryCommand cmd)`
    `protected void` | `sortDocSet(QueryResult qr, QueryCommand cmd)`
    `TermStatistics` | `termStatistics(Term term, TermContext context)`
    `String` | `toString()`
    `void` | `warm(SolrIndexSearcher old)` Warm this searcher based on an old one (primarily for auto-cache warming).
    `Sort` | `weightSort(Sort sort)` Returns a weighted sort according to this searcher

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

      `count, createNormalizedWeight, createWeight, explain, getDefaultQueryCache, getDefaultQueryCachingPolicy, getDefaultSimilarity, getQueryCache, getQueryCachingPolicy, getSimilarity, getTopReaderContext, rewrite, search, search, search, search, search, search, searchAfter, searchAfter, searchAfter, setDefaultQueryCache, setDefaultQueryCachingPolicy, setQueryCache, setQueryCachingPolicy, setSimilarity, slices`

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

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

- - ### Field Detail

    - #### STATS_SOURCE

          public static final String STATS_SOURCE

      See Also:
        Constant Field Values

    - #### STATISTICS_KEY

          public static final String STATISTICS_KEY

      See Also:
        Constant Field Values

    - #### numOpens

          public static final AtomicLong numOpens

    - #### numCloses

          public static final AtomicLong numCloses

    - #### enableLazyFieldLoading

          public final boolean enableLazyFieldLoading

    - #### NO_CHECK_QCACHE

          public static final int NO_CHECK_QCACHE

      See Also:
        Constant Field Values

    - #### GET_DOCSET

          public static final int GET_DOCSET

      See Also:
        Constant Field Values

    - #### TERMINATE_EARLY

          public static final int TERMINATE_EARLY

      See Also:
        Constant Field Values

    - #### GET_DOCLIST

          public static final int GET_DOCLIST

      See Also:
        Constant Field Values

    - #### GET_SCORES

          public static final int GET_SCORES

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SolrIndexSearcher

          public SolrIndexSearcher(SolrCore core,
                                   String path,
                                   IndexSchema schema,
                                   SolrIndexConfig config,
                                   String name,
                                   boolean enableCache,
                                   DirectoryFactory directoryFactory)
                            throws IOException

      Throws:
        `IOException`

    - #### SolrIndexSearcher

          public SolrIndexSearcher(SolrCore core,
                                   String path,
                                   IndexSchema schema,
                                   String name,
                                   DirectoryReader r,
                                   boolean closeReader,
                                   boolean enableCache,
                                   boolean reserveDirectory,
                                   DirectoryFactory directoryFactory)
                            throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### termStatistics

          public TermStatistics termStatistics(Term term,
                                               TermContext context)
                                        throws IOException

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

    - #### collectionStatistics

          public CollectionStatistics collectionStatistics(String field)
                                                    throws IOException

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

    - #### localTermStatistics

          public TermStatistics localTermStatistics(Term term,
                                                    TermContext context)
                                             throws IOException

      Throws:
        `IOException`

    - #### localCollectionStatistics

          public CollectionStatistics localCollectionStatistics(String field)
                                                         throws IOException

      Throws:
        `IOException`

    - #### isCachingEnabled

          public boolean isCachingEnabled()

    - #### getPath

          public String getPath()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `IndexSearcher`

    - #### getCore

          public SolrCore getCore()

    - #### maxDoc

          public final int maxDoc()

    - #### docFreq

          public final int docFreq(Term term)
                            throws IOException

      Throws:
        `IOException`

    - #### getSlowAtomicReader

          public final LeafReader getSlowAtomicReader()

      Not recommended to call this method unless there is some particular reason due to internally calling `SlowCompositeReaderWrapper`. Use `IndexSearcher.leafContexts` to get the sub readers instead of using this method.

    - #### getRawReader

          public final DirectoryReader getRawReader()

      Raw reader (no fieldcaches etc). Useful for operations like addIndexes

    - #### getIndexReader

          public final DirectoryReader getIndexReader()

      Overrides:
        `getIndexReader` in class `IndexSearcher`

    - #### register

          public void register()

      Register sub-objects such as caches

    - #### close

          public void close()
                     throws IOException

      Free's resources associated with this searcher. In particular, the underlying reader and any cache's in use are closed.
      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

    - #### getSchema

          public IndexSchema getSchema()

      Direct access to the IndexSchema for use with this searcher

    - #### getFieldNames

          public Iterable<String> getFieldNames()

      Returns a collection of all field names the index reader knows about.

    - #### getFilterCache

          public SolrCache<Query,DocSet> getFilterCache()

    - #### getStoredHighlightFieldNames

          public Collection<String> getStoredHighlightFieldNames()

      Returns a collection of the names of all stored fields which can be highlighted the index reader knows about.

    - #### initRegenerators

          public static void initRegenerators(SolrConfig solrConfig)

    - #### search

          public QueryResult search(QueryResult qr,
                                    QueryCommand cmd)
                             throws IOException

      Throws:
        `IOException`

    - #### doc

          public Document doc(int i)
                       throws IOException

      Retrieve the `Document` instance corresponding to the document id.
      Overrides:
        `doc` in class `IndexSearcher`
      Throws:
        `IOException`

    - #### doc

          public void doc(int n,
                          StoredFieldVisitor visitor)
                   throws IOException

      Visit a document's fields using a `StoredFieldVisitor` This method does not currently add to the Solr document cache.
      Overrides:
        `doc` in class `IndexSearcher`
      Throws:
        `IOException`
      See Also:
        `IndexReader.document(int, StoredFieldVisitor)`

    - #### doc

          public Document doc(int i,
                              Set<String> fields)
                       throws IOException

      Retrieve the `Document` instance corresponding to the document id.

      NOTE: the document will have all fields accessible, but if a field filter is provided, only the provided fields will be loaded (the remainder will be available lazily).

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

    - #### decorateDocValueFields

          public void decorateDocValueFields(SolrDocumentBase doc,
                                             int docid,
                                             Set<String> fields)
                                      throws IOException

      This will fetch and add the docValues fields to a given SolrDocument/SolrInputDocument
      Parameters:
        `doc` - A SolrDocument or SolrInputDocument instance where docValues will be added
        `docid` - The lucene docid of the document to be populated
        `fields` - The list of docValues fields to be decorated
      Throws:
        `IOException`

    - #### readDocs

          public void readDocs(Document[] docs,
                               DocList ids)
                        throws IOException

      Takes a list of docs (the doc ids actually), and reads them into an array of Documents.
      Throws:
        `IOException`

    - #### readDocs

          public void readDocs(Document[] docs,
                               DocList ids,
                               Set<String> fields)
                        throws IOException

      Takes a list of docs (the doc ids actually) and a set of fields to load, and reads them into an array of Documents.
      Throws:
        `IOException`

    - #### getNonStoredDVs

          public Set<String> getNonStoredDVs(boolean onlyUseDocValuesAsStored)

      Returns an unmodifiable set of non-stored docValues field names.
      Parameters:
        `onlyUseDocValuesAsStored` - If false, returns all non-stored docValues. If true, returns only those non-stored docValues which have the `SchemaField.useDocValuesAsStored()` flag true.

    - #### getNonStoredDVsWithoutCopyTargets

          public Set<String> getNonStoredDVsWithoutCopyTargets()

      Returns an unmodifiable set of names of non-stored docValues fields, except those that are targets of a copy field.

    - #### getFieldValueCache

          public SolrCache<String,UnInvertedField> getFieldValueCache()

      expert: internal API, subject to change

    - #### weightSort

          public Sort weightSort(Sort sort)
                          throws IOException

      Returns a weighted sort according to this searcher
      Throws:
        `IOException`

    - #### getFirstMatch

          public int getFirstMatch(Term t)
                            throws IOException

      Returns the first document number containing the term `t` Returns -1 if no document was found. This method is primarily intended for clients that want to fetch documents using a unique identifier."
      Returns:
        the first document number containing the term
      Throws:
        `IOException`

    - #### lookupId

          public long lookupId(BytesRef idBytes)
                        throws IOException

      lookup the docid by the unique key field, and return the id *within* the leaf reader in the low 32 bits, and the index of the leaf reader in the high 32 bits. -1 is returned if not found.
      Throws:
        `IOException`
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### cacheDocSet

          public void cacheDocSet(Query query,
                                  DocSet optionalAnswer,
                                  boolean mustCache)
                           throws IOException

      Compute and cache the DocSet that matches a query. The normal usage is expected to be cacheDocSet(myQuery, null,false) meaning that Solr will determine if the Query warrants caching, and if so, will compute the DocSet that matches the Query and cache it. If the answer to the query is already cached, nothing further will be done.

      If the optionalAnswer DocSet is provided, it should *not* be modified after this call.

      Parameters:
        `query` - the lucene query that will act as the key
        `optionalAnswer` - the DocSet to be cached - if null, it will be computed.
        `mustCache` - if true, a best effort will be made to cache this entry. if false, heuristics may be used to determine if it should be cached.
      Throws:
        `IOException`

    - #### getDocSetBits

          public BitDocSet getDocSetBits(Query q)
                                  throws IOException

      Throws:
        `IOException`

    - #### getDocSet

          public DocSet getDocSet(Query query)
                           throws IOException

      Returns the set of document ids matching a query. This method is cache-aware and attempts to retrieve the answer from the cache if possible. If the answer was not cached, it may have been inserted into the cache as a result of this call. This method can handle negative queries.

      The DocSet returned should not be modified.

      Throws:
        `IOException`

    - #### getLiveDocs

          public BitDocSet getLiveDocs()
                                throws IOException

      Throws:
        `IOException`

    - #### getDocSet

          public DocSet getDocSet(List<Query> queries)
                           throws IOException

      Returns the set of document ids matching all queries. This method is cache-aware and attempts to retrieve the answer from the cache if possible. If the answer was not cached, it may have been inserted into the cache as a result of this call. This method can handle negative queries.

      The DocSet returned should not be modified.

      Throws:
        `IOException`

    - #### getProcessedFilter

          public SolrIndexSearcher.ProcessedFilter getProcessedFilter(DocSet setFilter,
                                                                      List<Query> queries)
                                                               throws IOException

      Throws:
        `IOException`

    - #### getDocSet

          public DocSet getDocSet(SolrIndexSearcher.DocsEnumState deState)
                           throws IOException

      Throws:
        `IOException`
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### getDocSetNC

          protected DocSet getDocSetNC(Query query,
                                       DocSet filter)
                                throws IOException

      Throws:
        `IOException`

    - #### getDocSet

          public DocSet getDocSet(Query query,
                                  DocSet filter)
                           throws IOException

      Returns the set of document ids matching both the query and the filter. This method is cache-aware and attempts to retrieve the answer from the cache if possible. If the answer was not cached, it may have been inserted into the cache as a result of this call.

      Parameters:
        `filter` - may be null
      Returns:
        DocSet meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException`

    - #### getDocList

          public DocList getDocList(Query query,
                                    Query filter,
                                    Sort lsort,
                                    int offset,
                                    int len)
                             throws IOException

      Returns documents matching both `query` and `filter` and sorted by `sort`.

      This method is cache aware and may retrieve `filter` from the cache or make an insertion into the cache as a result of this call.

      FUTURE: The returned DocList may be retrieved from a cache.

      Parameters:
        `filter` - may be null
        `lsort` - criteria by which to sort (if null, query relevance is used)
        `offset` - offset into the list of documents to return
        `len` - maximum number of documents to return
      Returns:
        DocList meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### getDocList

          public DocList getDocList(Query query,
                                    List<Query> filterList,
                                    Sort lsort,
                                    int offset,
                                    int len,
                                    int flags)
                             throws IOException

      Returns documents matching both `query` and the intersection of the `filterList`, sorted by `sort`.

      This method is cache aware and may retrieve `filter` from the cache or make an insertion into the cache as a result of this call.

      FUTURE: The returned DocList may be retrieved from a cache.

      Parameters:
        `filterList` - may be null
        `lsort` - criteria by which to sort (if null, query relevance is used)
        `offset` - offset into the list of documents to return
        `len` - maximum number of documents to return
      Returns:
        DocList meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### getDocList

          public DocList getDocList(Query query,
                                    DocSet filter,
                                    Sort lsort,
                                    int offset,
                                    int len)
                             throws IOException

      Returns documents matching both `query` and `filter` and sorted by `sort`. FUTURE: The returned DocList may be retrieved from a cache.
      Parameters:
        `filter` - may be null
        `lsort` - criteria by which to sort (if null, query relevance is used)
        `offset` - offset into the list of documents to return
        `len` - maximum number of documents to return
      Returns:
        DocList meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### getDocListAndSet

          public DocListAndSet getDocListAndSet(Query query,
                                                Query filter,
                                                Sort lsort,
                                                int offset,
                                                int len)
                                         throws IOException

      Returns documents matching both `query` and `filter` and sorted by `sort`. Also returns the complete set of documents matching `query` and `filter` (regardless of `offset` and `len`).

      This method is cache aware and may retrieve `filter` from the cache or make an insertion into the cache as a result of this call.

      FUTURE: The returned DocList may be retrieved from a cache.

      The DocList and DocSet returned should not be modified.

      Parameters:
        `filter` - may be null
        `lsort` - criteria by which to sort (if null, query relevance is used)
        `offset` - offset into the list of documents to return
        `len` - maximum number of documents to return
      Returns:
        DocListAndSet meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### getDocListAndSet

          public DocListAndSet getDocListAndSet(Query query,
                                                Query filter,
                                                Sort lsort,
                                                int offset,
                                                int len,
                                                int flags)
                                         throws IOException

      Returns documents matching both `query` and `filter` and sorted by `sort`. Also returns the compete set of documents matching `query` and `filter` (regardless of `offset` and `len`).

      This method is cache aware and may retrieve `filter` from the cache or make an insertion into the cache as a result of this call.

      FUTURE: The returned DocList may be retrieved from a cache.

      The DocList and DocSet returned should not be modified.

      Parameters:
        `filter` - may be null
        `lsort` - criteria by which to sort (if null, query relevance is used)
        `offset` - offset into the list of documents to return
        `len` - maximum number of documents to return
        `flags` - user supplied flags for the result set
      Returns:
        DocListAndSet meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### getDocListAndSet

          public DocListAndSet getDocListAndSet(Query query,
                                                List<Query> filterList,
                                                Sort lsort,
                                                int offset,
                                                int len)
                                         throws IOException

      Returns documents matching both `query` and the intersection of `filterList`, sorted by `sort`. Also returns the compete set of documents matching `query` and `filter` (regardless of `offset` and `len`).

      This method is cache aware and may retrieve `filter` from the cache or make an insertion into the cache as a result of this call.

      FUTURE: The returned DocList may be retrieved from a cache.

      The DocList and DocSet returned should not be modified.

      Parameters:
        `filterList` - may be null
        `lsort` - criteria by which to sort (if null, query relevance is used)
        `offset` - offset into the list of documents to return
        `len` - maximum number of documents to return
      Returns:
        DocListAndSet meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### getDocListAndSet

          public DocListAndSet getDocListAndSet(Query query,
                                                List<Query> filterList,
                                                Sort lsort,
                                                int offset,
                                                int len,
                                                int flags)
                                         throws IOException

      Returns documents matching both `query` and the intersection of `filterList`, sorted by `sort`. Also returns the compete set of documents matching `query` and `filter` (regardless of `offset` and `len`).

      This method is cache aware and may retrieve `filter` from the cache or make an insertion into the cache as a result of this call.

      FUTURE: The returned DocList may be retrieved from a cache.

      The DocList and DocSet returned should not be modified.

      Parameters:
        `filterList` - may be null
        `lsort` - criteria by which to sort (if null, query relevance is used)
        `offset` - offset into the list of documents to return
        `len` - maximum number of documents to return
        `flags` - user supplied flags for the result set
      Returns:
        DocListAndSet meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### getDocListAndSet

          public DocListAndSet getDocListAndSet(Query query,
                                                DocSet filter,
                                                Sort lsort,
                                                int offset,
                                                int len)
                                         throws IOException

      Returns documents matching both `query` and `filter` and sorted by `sort`. Also returns the compete set of documents matching `query` and `filter` (regardless of `offset` and `len`).

      FUTURE: The returned DocList may be retrieved from a cache.

      Parameters:
        `filter` - may be null
        `lsort` - criteria by which to sort (if null, query relevance is used)
        `offset` - offset into the list of documents to return
        `len` - maximum number of documents to return
      Returns:
        DocListAndSet meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### getDocListAndSet

          public DocListAndSet getDocListAndSet(Query query,
                                                DocSet filter,
                                                Sort lsort,
                                                int offset,
                                                int len,
                                                int flags)
                                         throws IOException

      Returns documents matching both `query` and `filter` and sorted by `sort`. Also returns the compete set of documents matching `query` and `filter` (regardless of `offset` and `len`).

      This method is cache aware and may make an insertion into the cache as a result of this call.

      FUTURE: The returned DocList may be retrieved from a cache.

      The DocList and DocSet returned should not be modified.

      Parameters:
        `filter` - may be null
        `lsort` - criteria by which to sort (if null, query relevance is used)
        `offset` - offset into the list of documents to return
        `len` - maximum number of documents to return
        `flags` - user supplied flags for the result set
      Returns:
        DocListAndSet meeting the specified criteria, should not be modified by the caller.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### sortDocSet

          protected void sortDocSet(QueryResult qr,
                                    QueryCommand cmd)
                             throws IOException

      Throws:
        `IOException`

    - #### numDocs

          public int numDocs(Query a,
                             DocSet b)
                      throws IOException

      Returns the number of documents that match both `a` and `b`.

      This method is cache-aware and may check as well as modify the cache.

      Returns:
        the number of documents in the intersection between `a` and `b`.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### numDocs

          public int numDocs(DocSet a,
                             SolrIndexSearcher.DocsEnumState deState)
                      throws IOException

      Throws:
        `IOException`
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### numDocs

          public int numDocs(Query a,
                             Query b)
                      throws IOException

      Returns the number of documents that match both `a` and `b`.

      This method is cache-aware and may check as well as modify the cache.

      Returns:
        the number of documents in the intersection between `a` and `b`.
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### intersects

          public boolean intersects(DocSet a,
                                    SolrIndexSearcher.DocsEnumState deState)
                             throws IOException

      Throws:
        `IOException`
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### readDocs

          public Document[] readDocs(DocList ids)
                              throws IOException

      Takes a list of document IDs, and returns an array of Documents containing all of the stored fields.
      Throws:
        `IOException`

    - #### warm

          public void warm(SolrIndexSearcher old)

      Warm this searcher based on an old one (primarily for auto-cache warming).

    - #### getCache

          public SolrCache getCache(String cacheName)

      return the named generic cache

    - #### cacheLookup

          public Object cacheLookup(String cacheName,
                                    Object key)

      lookup an entry in a generic cache

    - #### cacheInsert

          public Object cacheInsert(String cacheName,
                                    Object key,
                                    Object val)

      insert an entry in a generic cache

    - #### getOpenTimeStamp

          public Date getOpenTimeStamp()

    - #### getOpenNanoTime

          public long getOpenNanoTime()

    - #### explain

          public Explanation explain(Query query,
                                     int doc)
                              throws IOException

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

    - #### getIndexFingerprint

          public IndexFingerprint getIndexFingerprint(long maxVersion)
                                               throws IOException

      Throws:
        `IOException`
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
        gets a cached version of the IndexFingerprint for this searcher

    - #### getName

          public String getName()

      Description copied from interface: `SolrInfoMBean`
      Simple common usage name, e.g. BasicQueryHandler, or fully qualified clas name.
      Specified by:
        `getName` in interface `SolrInfoMBean`

    - #### getVersion

          public String getVersion()

      Description copied from interface: `SolrInfoMBean`
      Simple common usage version, e.g. 2.0
      Specified by:
        `getVersion` in interface `SolrInfoMBean`

    - #### getDescription

          public String getDescription()

      Description copied from interface: `SolrInfoMBean`
      Simple one or two line description
      Specified by:
        `getDescription` in interface `SolrInfoMBean`

    - #### getCategory

          public SolrInfoMBean.Category getCategory()

      Description copied from interface: `SolrInfoMBean`
      Purpose of this Class
      Specified by:
        `getCategory` in interface `SolrInfoMBean`

    - #### getSource

          public String getSource()

      Description copied from interface: `SolrInfoMBean`
      CVS Source, SVN Source, etc
      Specified by:
        `getSource` in interface `SolrInfoMBean`

    - #### getDocs

          public URL[] getDocs()

      Description copied from interface: `SolrInfoMBean`
      Documentation URL list.

      Suggested documentation URLs: Homepage for sponsoring project, FAQ on class usage, Design doc for class, Wiki, bug reporting URL, etc...

      Specified by:
        `getDocs` in interface `SolrInfoMBean`

    - #### getStatistics

          public NamedList<Object> getStatistics()

      Description copied from interface: `SolrInfoMBean`
      Any statistics this instance would like to be publicly available via the Solr Administration interface.

      Any Object type may be stored in the list, but only the `toString()` representation will be used.

      Specified by:
        `getStatistics` in interface `SolrInfoMBean`

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