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

FilterIndexReader.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 FILTERINDEXREADER_H
8 #define FILTERINDEXREADER_H
9
10 #include "IndexReader.h"
11 #include "TermPositions.h"
12 #include "TermEnum.h"
13
14 namespace Lucene {
15
21 class LPPAPI FilterIndexReader : public IndexReader {
22 public:
28 FilterIndexReader(const IndexReaderPtr& in);
29
30 virtual ~FilterIndexReader();
31
32 LUCENE_CLASS(FilterIndexReader);
33
34 protected:
35 IndexReaderPtr in;
36
37 public:
38 virtual DirectoryPtr directory();
39 virtual Collection<TermFreqVectorPtr> getTermFreqVectors(int32_t docNumber);
40 virtual TermFreqVectorPtr getTermFreqVector(int32_t docNumber, const String& field);
41 virtual void getTermFreqVector(int32_t docNumber, const String& field, const TermVectorMapperPtr& mapper);
42 virtual void getTermFreqVector(int32_t docNumber, const TermVectorMapperPtr& mapper);
43 virtual int32_t numDocs();
44 virtual int32_t maxDoc();
45 virtual DocumentPtr document(int32_t n, const FieldSelectorPtr& fieldSelector);
46 virtual bool isDeleted(int32_t n);
47 virtual bool hasDeletions();
48 virtual bool hasNorms(const String& field);
49 virtual ByteArray norms(const String& field);
50 virtual void norms(const String& field, ByteArray norms, int32_t offset);
51 virtual TermEnumPtr terms();
52 virtual TermEnumPtr terms(const TermPtr& t);
53 virtual int32_t docFreq(const TermPtr& t);
54 virtual TermDocsPtr termDocs();
55 virtual TermDocsPtr termDocs(const TermPtr& term);
56 virtual TermPositionsPtr termPositions();
57 virtual HashSet<String> getFieldNames(FieldOption fieldOption);
58 virtual int64_t getVersion();
59 virtual bool isCurrent();
60 virtual bool isOptimized();
61 virtual Collection<IndexReaderPtr> getSequentialSubReaders();
62
65 virtual LuceneObjectPtr getFieldCacheKey();
66
69 virtual LuceneObjectPtr getDeletesCacheKey();
70
71 protected:
72 virtual void doUndeleteAll();
73 virtual void doSetNorm(int32_t doc, const String& field, uint8_t value);
74 virtual void doDelete(int32_t docNum);
75 virtual void doCommit(MapStringString commitUserData);
76 virtual void doClose();
77 };
78
80 class LPPAPI FilterTermDocs : public TermPositions, public LuceneObject {
81 public:
82 FilterTermDocs(const TermDocsPtr& in);
83 virtual ~FilterTermDocs();
84
85 LUCENE_CLASS(FilterTermDocs);
86
87 protected:
88 TermDocsPtr in;
89
90 public:
91 virtual void seek(const TermPtr& term);
92 virtual void seek(const TermEnumPtr& termEnum);
93 virtual int32_t doc();
94 virtual int32_t freq();
95 virtual bool next();
96 virtual int32_t read(Collection<int32_t> docs, Collection<int32_t> freqs);
97 virtual bool skipTo(int32_t target);
98 virtual void close();
99 };
100
102 class LPPAPI FilterTermPositions : public FilterTermDocs {
103 public:
104 FilterTermPositions(const TermPositionsPtr& in);
105 virtual ~FilterTermPositions();
106
107 LUCENE_CLASS(FilterTermPositions);
108
109 public:
110 virtual int32_t nextPosition();
111 virtual int32_t getPayloadLength();
112 virtual ByteArray getPayload(ByteArray data, int32_t offset);
113 virtual bool isPayloadAvailable();
114 };
115
117 class LPPAPI FilterTermEnum : public TermEnum {
118 public:
119 FilterTermEnum(const TermEnumPtr& in);
120 virtual ~FilterTermEnum();
121
122 LUCENE_CLASS(FilterTermEnum);
123
124 protected:
125 TermEnumPtr in;
126
127 public:
128 virtual bool next();
129 virtual TermPtr term();
130 virtual int32_t docFreq();
131 virtual void close();
132 };
133
134 }
135
136 #endif
Lucene::FilterTermDocs
Base class for filtering TermDocs implementations.
Definition: FilterIndexReader.h:80
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::TermPtr
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition: Collection.h:17
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
TermEnum.h
Lucene::FilterTermEnum
Base class for filtering TermEnum implementations.
Definition: FilterIndexReader.h:117
Lucene::TermVectorMapperPtr
boost::shared_ptr< TermVectorMapper > TermVectorMapperPtr
Definition: LuceneTypes.h:254
Lucene::FilterTermPositions
Base class for filtering TermPositions implementations.
Definition: FilterIndexReader.h:102
Lucene::DocumentPtr
boost::shared_ptr< Document > DocumentPtr
Definition: LuceneTypes.h:74
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::TermEnum
Abstract class for enumerating terms.
Definition: TermEnum.h:18
Lucene::TermEnumPtr
boost::shared_ptr< TermEnum > TermEnumPtr
Definition: LuceneTypes.h:235
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
Lucene::TermDocsPtr
boost::shared_ptr< TermDocs > TermDocsPtr
Definition: LuceneTypes.h:236
Lucene::TermPositions
TermPositions provides an interface for enumerating the <document, frequency, <position>*> tuples for...
Definition: TermPositions.h:18
Lucene::HashSet< String >
TermPositions.h
Lucene::IndexReader
IndexReader is an abstract class, providing an interface for accessing an index. Search of an index i...
Definition: IndexReader.h:39
Lucene::TermFreqVectorPtr
boost::shared_ptr< TermFreqVector > TermFreqVectorPtr
Definition: LuceneTypes.h:237
IndexReader.h
Lucene::IndexReader::FieldOption
FieldOption
Constants describing field properties, for example used for IndexReader#getFieldNames(FieldOption).
Definition: IndexReader.h:48
Lucene::FilterIndexReader
A FilterIndexReader contains another IndexReader, which it uses as its basic source of data,...
Definition: FilterIndexReader.h:21
Lucene::TermPositionsPtr
boost::shared_ptr< TermPositions > TermPositionsPtr
Definition: LuceneTypes.h:243
Lucene::DirectoryPtr
boost::shared_ptr< Directory > DirectoryPtr
Definition: LuceneTypes.h:489
Lucene::FieldSelectorPtr
boost::shared_ptr< FieldSelector > FieldSelectorPtr
Definition: LuceneTypes.h:77

clucene.sourceforge.net