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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CachingWrapperFilter.h
Go to the documentation of this file.
1 // 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 
41 
42 INTERNAL:
43  FilterPtr filter;
44 
45  // for testing
46  int32_t hitCount;
47  int32_t missCount;
48 
49 protected:
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
boost::shared_ptr< DocIdSet > DocIdSetPtr
Definition: LuceneTypes.h:323
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
int32_t hitCount
Definition: CachingWrapperFilter.h:46
FilterCachePtr cache
A Filter cache.
Definition: CachingWrapperFilter.h:51
Wraps another filter's result and caches it. The purpose is to allow filters to simply filter...
Definition: CachingWrapperFilter.h:16
Abstract base class for restricting which documents may be returned during searching.
Definition: Filter.h:15
int32_t missCount
Definition: CachingWrapperFilter.h:47
DeletesMode
Specifies how new deletions against a reopened reader should be handled.
Definition: CachingWrapperFilter.h:30
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< FilterCache > FilterCachePtr
Definition: LuceneTypes.h:359
boost::shared_ptr< Filter > FilterPtr
Definition: LuceneTypes.h:358

clucene.sourceforge.net