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


TermVectorsTermsWriter.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 TERMVECTORSTERMSWRITER_H
8 #define TERMVECTORSTERMSWRITER_H
9 
10 #include "TermsHashConsumer.h"
11 #include "DocumentsWriter.h"
12 #include "RawPostingList.h"
13 
14 namespace Lucene {
15 
17 public:
20 
22 
23 public:
27  int32_t freeCount;
31  int32_t lastDocID;
32  int32_t allocCount;
33 
34 public:
36  virtual void createPostings(Collection<RawPostingListPtr> postings, int32_t start, int32_t count);
37  virtual void flush(MapTermsHashConsumerPerThreadCollectionTermsHashConsumerPerField threadsAndFields, const SegmentWriteStatePtr& state);
38  virtual void closeDocStore(const SegmentWriteStatePtr& state);
39 
41 
43  void fill(int32_t docID);
44 
47  bool freeRAM();
49 
50  virtual void abort();
51  virtual int32_t bytesPerPosting();
52 };
53 
55 public:
58 
60 
61 protected:
63 
64 public:
67  int32_t numVectorFields;
68 
71 
72 public:
73  void reset();
74  virtual void abort();
75  void addField(int32_t fieldNumber);
76  virtual int64_t sizeInBytes();
77  virtual void finish();
78 };
79 
81 public:
84 
86 
87 public:
88  int32_t freq; // How many times this term occurred in the current doc
89  int32_t lastOffset; // Last offset we saw
90  int32_t lastPosition; // Last position where this term occurred
91 };
92 
93 }
94 
95 #endif
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Consumer returns this on each doc. This holds any state that must be flushed synchronized "in docID o...
Definition: DocumentsWriter.h:402
This is the base class for an in-memory posting list, keyed by a Token. TermsHash maintains a hash ta...
Definition: RawPostingList.h:19
Definition: TermVectorsTermsWriter.h:54
TermVectorsTermsWriterPerDoc(const TermVectorsTermsWriterPtr &termsWriter=TermVectorsTermsWriterPtr())
void addField(int32_t fieldNumber)
PerDocBufferPtr buffer
Definition: TermVectorsTermsWriter.h:65
Collection< int64_t > fieldPointers
Definition: TermVectorsTermsWriter.h:70
RAMOutputStreamPtr perDocTvf
Definition: TermVectorsTermsWriter.h:66
Collection< int32_t > fieldNumbers
Definition: TermVectorsTermsWriter.h:69
TermVectorsTermsWriterWeakPtr _termsWriter
Definition: TermVectorsTermsWriter.h:59
int32_t numVectorFields
Definition: TermVectorsTermsWriter.h:67
Definition: TermVectorsTermsWriter.h:80
int32_t freq
Definition: TermVectorsTermsWriter.h:85
int32_t lastOffset
Definition: TermVectorsTermsWriter.h:89
int32_t lastPosition
Definition: TermVectorsTermsWriter.h:90
Definition: TermVectorsTermsWriter.h:16
Collection< TermVectorsTermsWriterPerDocPtr > docFreeList
Definition: TermVectorsTermsWriter.h:26
virtual void createPostings(Collection< RawPostingListPtr > postings, int32_t start, int32_t count)
void fill(int32_t docID)
Fills in no-term-vectors for all docs we haven't seen since the last doc that had term vectors.
virtual void flush(MapTermsHashConsumerPerThreadCollectionTermsHashConsumerPerField threadsAndFields, const SegmentWriteStatePtr &state)
TermVectorsWriterPtr termVectorsWriter
Definition: TermVectorsTermsWriter.h:25
IndexOutputPtr tvd
Definition: TermVectorsTermsWriter.h:29
int32_t lastDocID
Definition: TermVectorsTermsWriter.h:31
void free(const TermVectorsTermsWriterPerDocPtr &doc)
int32_t allocCount
Definition: TermVectorsTermsWriter.h:32
IndexOutputPtr tvx
Definition: TermVectorsTermsWriter.h:28
virtual void closeDocStore(const SegmentWriteStatePtr &state)
TermVectorsTermsWriter(const DocumentsWriterPtr &docWriter)
void finishDocument(const TermVectorsTermsWriterPerDocPtr &perDoc)
virtual int32_t bytesPerPosting()
IndexOutputPtr tvf
Definition: TermVectorsTermsWriter.h:30
DocumentsWriterWeakPtr _docWriter
Definition: TermVectorsTermsWriter.h:21
TermVectorsTermsWriterPerDocPtr getPerDoc()
int32_t freeCount
Definition: TermVectorsTermsWriter.h:27
virtual TermsHashConsumerPerThreadPtr addThread(const TermsHashPerThreadPtr &perThread)
Definition: TermsHashConsumer.h:14
Definition: AbstractAllTermDocs.h:12
boost::weak_ptr< TermVectorsTermsWriter > TermVectorsTermsWriterWeakPtr
Definition: LuceneTypes.h:258
boost::shared_ptr< TermVectorsWriter > TermVectorsWriterPtr
Definition: LuceneTypes.h:263
boost::shared_ptr< TermsHashConsumerPerThread > TermsHashConsumerPerThreadPtr
Definition: LuceneTypes.h:249
boost::shared_ptr< TermVectorsTermsWriter > TermVectorsTermsWriterPtr
Definition: LuceneTypes.h:258
boost::shared_ptr< DocumentsWriter > DocumentsWriterPtr
Definition: LuceneTypes.h:123
boost::shared_ptr< SegmentWriteState > SegmentWriteStatePtr
Definition: LuceneTypes.h:222
boost::weak_ptr< DocumentsWriter > DocumentsWriterWeakPtr
Definition: LuceneTypes.h:123
boost::shared_ptr< TermVectorsTermsWriterPerDoc > TermVectorsTermsWriterPerDocPtr
Definition: LuceneTypes.h:259
boost::shared_ptr< TermsHashPerThread > TermsHashPerThreadPtr
Definition: LuceneTypes.h:251
boost::shared_ptr< IndexOutput > IndexOutputPtr
Definition: LuceneTypes.h:494
boost::shared_ptr< PerDocBuffer > PerDocBufferPtr
Definition: LuceneTypes.h:199
boost::shared_ptr< RAMOutputStream > RAMOutputStreamPtr
Definition: LuceneTypes.h:508

clucene.sourceforge.net