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
12 namespace Lucene {
13
16 class LPPAPI CachingWrapperFilter : public Filter {
17 public:
30 enum DeletesMode { DELETES_IGNORE, DELETES_RECACHE, DELETES_DYNAMIC };
31
36 CachingWrapperFilter(const FilterPtr& filter, DeletesMode deletesMode = DELETES_IGNORE);
37
38 virtual ~CachingWrapperFilter();
39
40 LUCENE_CLASS(CachingWrapperFilter);
41
42INTERNAL:
43 FilterPtr filter;
44
45 // for testing
46 int32_t hitCount;
47 int32_t missCount;
48
49 protected:
51 FilterCachePtr cache;
52
57 DocIdSetPtr docIdSetToCache(const DocIdSetPtr& docIdSet, const IndexReaderPtr& reader);
58
59 public:
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
Filter.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::CachingWrapperFilter
Wraps another filter's result and caches it. The purpose is to allow filters to simply filter,...
Definition CachingWrapperFilter.h:16
Lucene::CachingWrapperFilter::missCount
int32_t missCount
Definition CachingWrapperFilter.h:47
Lucene::CachingWrapperFilter::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::CachingWrapperFilter::cache
FilterCachePtr cache
A Filter cache.
Definition CachingWrapperFilter.h:51
Lucene::CachingWrapperFilter::~CachingWrapperFilter
virtual ~CachingWrapperFilter()
Lucene::CachingWrapperFilter::getDocIdSet
virtual DocIdSetPtr getDocIdSet(const IndexReaderPtr &reader)
Creates a DocIdSet enumerating the documents that should be permitted in search results.
Lucene::CachingWrapperFilter::docIdSetToCache
DocIdSetPtr docIdSetToCache(const DocIdSetPtr &docIdSet, const IndexReaderPtr &reader)
Provide the DocIdSet to be cached, using the DocIdSet provided by the wrapped Filter.
Lucene::CachingWrapperFilter::DeletesMode
DeletesMode
Specifies how new deletions against a reopened reader should be handled.
Definition CachingWrapperFilter.h:30
Lucene::CachingWrapperFilter::toString
virtual String toString()
Returns a string representation of the object.
Lucene::CachingWrapperFilter::CachingWrapperFilter
CachingWrapperFilter(const FilterPtr &filter, DeletesMode deletesMode=DELETES_IGNORE)
New deletes are ignored by default, which gives higher cache hit rate on reopened readers....
Lucene::CachingWrapperFilter::hitCount
int32_t hitCount
Definition CachingWrapperFilter.h:46
Lucene::CachingWrapperFilter::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::Filter
Abstract base class for restricting which documents may be returned during searching.
Definition Filter.h:15
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
Lucene::DocIdSetPtr
boost::shared_ptr< DocIdSet > DocIdSetPtr
Definition LuceneTypes.h:323
Lucene::FilterCachePtr
boost::shared_ptr< FilterCache > FilterCachePtr
Definition LuceneTypes.h:359
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition LuceneTypes.h:157
Lucene::FilterPtr
boost::shared_ptr< Filter > FilterPtr
Definition LuceneTypes.h:358

clucene.sourceforge.net