Lucene.Net
3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
|
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. More...
Inherits Lucene.Net.Search.Filter.
Classes | |
class | FilterCache< T > |
Public Types | |
enum | DeletesMode { IGNORE, RECACHE, DYNAMIC } |
Public Member Functions | |
CachingWrapperFilter (Filter filter) | |
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 DeletesMode.RECACHE or DeletesMode.DYNAMIC. | |
CachingWrapperFilter (Filter filter, DeletesMode deletesMode) | |
Expert: by default, the cached filter will be shared across reopened segments that only had changes to their deletions. | |
override DocIdSet | GetDocIdSet (IndexReader reader) |
| |
override System.String | ToString () |
override bool | Equals (System.Object o) |
override int | GetHashCode () |
Public Attributes | |
int | hitCount |
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.
Definition at line 33 of file CachingWrapperFilter.cs.
Expert: Specifies how new deletions against a reopened reader should be handled.
The default is IGNORE, which means the cache entry will be re-used for a given segment, even when that segment has been reopened due to changes in deletions. This is a big performance gain, especially with near-real-timer readers, since you don't hit a cache miss on every reopened reader for prior segments.
However, in some cases this can cause invalid query results, allowing deleted documents to be returned. This only happens if the main query does not rule out deleted documents on its own, such as a toplevel ConstantScoreQuery. To fix this, use RECACHE to re-create the cached filter (at a higher per-reopen cost, but at faster subsequent search performance), or use DYNAMIC to dynamically intersect deleted docs (fast reopen time but some hit to search performance).
Enumerator | |
---|---|
IGNORE | |
RECACHE | |
DYNAMIC |
Definition at line 58 of file CachingWrapperFilter.cs.
Lucene.Net.Search.CachingWrapperFilter.CachingWrapperFilter | ( | Filter | filter | ) |
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 DeletesMode.RECACHE or DeletesMode.DYNAMIC.
filter | Filter to cache results of |
Definition at line 158 of file CachingWrapperFilter.cs.
Lucene.Net.Search.CachingWrapperFilter.CachingWrapperFilter | ( | Filter | filter, |
DeletesMode | deletesMode | ||
) |
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 DeletesMode |
Definition at line 170 of file CachingWrapperFilter.cs.
override bool Lucene.Net.Search.CachingWrapperFilter.Equals | ( | System.Object | o | ) |
Definition at line 267 of file CachingWrapperFilter.cs.
|
virtual |
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.
/summary>
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. |
Implements Lucene.Net.Search.Filter.
Definition at line 238 of file CachingWrapperFilter.cs.
override int Lucene.Net.Search.CachingWrapperFilter.GetHashCode | ( | ) |
Definition at line 274 of file CachingWrapperFilter.cs.
override System.String Lucene.Net.Search.CachingWrapperFilter.ToString | ( | ) |
Definition at line 262 of file CachingWrapperFilter.cs.
int Lucene.Net.Search.CachingWrapperFilter.hitCount |
Definition at line 236 of file CachingWrapperFilter.cs.