Lucene++ - a full-featured, c++ search engine
API Documentation


Loading...
Searching...
No Matches
CachingWrapperFilter.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef CACHINGWRAPPERFILTER_H
8#define CACHINGWRAPPERFILTER_H
9
10#include "Filter.h"
11
12namespace Lucene {
13
16class LPPAPI CachingWrapperFilter : public Filter {
17public:
30 enum DeletesMode { DELETES_IGNORE, DELETES_RECACHE, DELETES_DYNAMIC };
31
36 CachingWrapperFilter(const FilterPtr& filter, DeletesMode deletesMode = DELETES_IGNORE);
37
39
41
42INTERNAL:
43 FilterPtr filter;
44
45 // for testing
46 int32_t hitCount;
47 int32_t missCount;
48
49protected:
52
57 DocIdSetPtr docIdSetToCache(const DocIdSetPtr& docIdSet, const IndexReaderPtr& reader);
58
59public:
60 virtual DocIdSetPtr getDocIdSet(const IndexReaderPtr& reader);
61
62 virtual String toString();
63 virtual bool equals(const LuceneObjectPtr& other);
64 virtual int32_t hashCode();
65};
66
67}
68
69#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Wraps another filter's result and caches it. The purpose is to allow filters to simply filter,...
Definition CachingWrapperFilter.h:16
int32_t missCount
Definition CachingWrapperFilter.h:47
virtual int32_t hashCode()
Return hash code for this object.
FilterCachePtr cache
A Filter cache.
Definition CachingWrapperFilter.h:51
virtual DocIdSetPtr getDocIdSet(const IndexReaderPtr &reader)
Creates a DocIdSet enumerating the documents that should be permitted in search results.
DocIdSetPtr docIdSetToCache(const DocIdSetPtr &docIdSet, const IndexReaderPtr &reader)
Provide the DocIdSet to be cached, using the DocIdSet provided by the wrapped Filter.
DeletesMode
Specifies how new deletions against a reopened reader should be handled.
Definition CachingWrapperFilter.h:30
virtual String toString()
Returns a string representation of the object.
CachingWrapperFilter(const FilterPtr &filter, DeletesMode deletesMode=DELETES_IGNORE)
New deletes are ignored by default, which gives higher cache hit rate on reopened readers....
int32_t hitCount
Definition CachingWrapperFilter.h:46
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Abstract base class for restricting which documents may be returned during searching.
Definition Filter.h:15
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
boost::shared_ptr< DocIdSet > DocIdSetPtr
Definition LuceneTypes.h:323
boost::shared_ptr< FilterCache > FilterCachePtr
Definition LuceneTypes.h:359
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition LuceneTypes.h:157
boost::shared_ptr< Filter > FilterPtr
Definition LuceneTypes.h:358

clucene.sourceforge.net