Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Lucene.Net.Search.CachingWrapperFilter Class Reference

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
 

Detailed Description

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.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

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.

Parameters
filterFilter 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.

Parameters
filterFilter to cache results of
deletesModeSee DeletesMode

Definition at line 170 of file CachingWrapperFilter.cs.

Member Function Documentation

override bool Lucene.Net.Search.CachingWrapperFilter.Equals ( System.Object  o)

Definition at line 267 of file CachingWrapperFilter.cs.

override DocIdSet Lucene.Net.Search.CachingWrapperFilter.GetDocIdSet ( IndexReader  reader)
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>

Returns
a DocIdSet that provides the documents which should be permitted or prohibited in search results. NOTE: null can be returned if no documents will be accepted by this Filter.
Parameters
readerA 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.
See Also
DocIdBitSet

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.

Member Data Documentation

int Lucene.Net.Search.CachingWrapperFilter.hitCount

Definition at line 236 of file CachingWrapperFilter.cs.


The documentation for this class was generated from the following file: