public class IndexSearcherWrapper
extends java.lang.Object
DirectoryReader
and IndexSearcher managed by the IndexShard.| Constructor and Description |
|---|
IndexSearcherWrapper() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.lucene.index.DirectoryReader |
wrap(org.apache.lucene.index.DirectoryReader reader)
Wraps the given
DirectoryReader. |
Engine.Searcher |
wrap(Engine.Searcher engineSearcher)
If there are configured
IndexSearcherWrapper instances, the IndexSearcher of the provided engine searcher
gets wrapped and a new Engine.Searcher instances is returned, otherwise the provided Engine.Searcher is returned. |
protected org.apache.lucene.search.IndexSearcher |
wrap(org.apache.lucene.search.IndexSearcher searcher) |
protected org.apache.lucene.index.DirectoryReader wrap(org.apache.lucene.index.DirectoryReader reader)
throws java.io.IOException
DirectoryReader. The wrapped reader can filter out document just like delete documents etc. but
must not change any term or document content.
NOTE: The wrapper has a per-request lifecycle, must delegate IndexReader.getReaderCacheHelper(),
LeafReader.getCoreCacheHelper() and must be an instance of FilterDirectoryReader that
eventually exposes the original reader via FilterDirectoryReader.getDelegate().
The returned reader is closed once it goes out of scope.
reader - The provided directory reader to be wrapped to add custom functionalityjava.io.IOExceptionprotected org.apache.lucene.search.IndexSearcher wrap(org.apache.lucene.search.IndexSearcher searcher)
throws java.io.IOException
searcher - The provided index searcher to be wrapped to add custom functionalityjava.io.IOExceptionpublic final Engine.Searcher wrap(Engine.Searcher engineSearcher) throws java.io.IOException
IndexSearcherWrapper instances, the IndexSearcher of the provided engine searcher
gets wrapped and a new Engine.Searcher instances is returned, otherwise the provided Engine.Searcher is returned.
This is invoked each time a Engine.Searcher is requested to do an operation. (for example search)java.io.IOException