java.lang.Object | ||
↳ | org.apache.lucene.search.Filter | |
↳ | org.apache.lucene.search.CachingWrapperFilter |
Wraps another filter's result and caches it. The purpose is to allow filters to simply filter, and then wrap with this class to add caching.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CachingWrapperFilter.DeletesMode | Expert: Specifies how new deletions against a reopened reader should be handled. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cache |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
New deletes are ignored by default, which gives higher
cache hit rate on reopened readers.
| |||||||||||
Expert: by default, the cached filter will be shared
across reopened segments that only had changes to their
deletions.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a
DocIdSet enumerating the documents that should be
permitted in search results. | |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Provide the DocIdSet to be cached, using the DocIdSet provided
by the wrapped Filter.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.search.Filter
| |||||||||||
From class
java.lang.Object
|
New deletes are ignored by default, which gives higher
cache hit rate on reopened readers. Most of the time
this is safe, because the filter will be AND'd with a
Query that fully enforces deletions. If instead you
need this filter to always enforce deletions, pass
either RECACHE
or DYNAMIC
.
filter | Filter to cache results of |
---|
Expert: by default, the cached filter will be shared across reopened segments that only had changes to their deletions.
filter | Filter to cache results of |
---|---|
deletesMode | See CachingWrapperFilter.DeletesMode
|
Creates a DocIdSet
enumerating the documents that should be
permitted in search results. NOTE: null can be
returned if no documents are accepted by this Filter.
Note: This method will be called once per segment in
the index during searching. The returned DocIdSet
must refer to document IDs for that segment, not for
the top-level reader.
reader | a IndexReader instance opened on the index currently
searched on. Note, it is likely that the provided reader does not
represent the whole underlying index i.e. if the index has more than
one segment the given reader only represents a single segment. |
---|
IOException |
---|
Provide the DocIdSet to be cached, using the DocIdSet provided by the wrapped Filter.
This implementation returns the given DocIdSet
, if isCacheable()
returns true
, else it copies the DocIdSetIterator
into
an OpenBitSetDISI
.
IOException |
---|