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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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:
19  virtual ~TermVectorsTermsWriter();
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 
45  void initTermVectorsWriter();
47  bool freeRAM();
48  void free(const TermVectorsTermsWriterPerDocPtr& doc);
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
IndexOutputPtr tvx
Definition: TermVectorsTermsWriter.h:28
Definition: TermsHashConsumer.h:14
boost::shared_ptr< TermsHashConsumerPerThread > TermsHashConsumerPerThreadPtr
Definition: LuceneTypes.h:249
DocumentsWriterWeakPtr _docWriter
Definition: TermVectorsTermsWriter.h:21
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...
boost::shared_ptr< IndexOutput > IndexOutputPtr
Definition: LuceneTypes.h:494
virtual void flush(MapTermsHashConsumerPerThreadCollectionTermsHashConsumerPerField threadsAndFields, const SegmentWriteStatePtr &state)
void free(const TermVectorsTermsWriterPerDocPtr &doc)
This is the base class for an in-memory posting list, keyed by a Token. TermsHash maintains a hash ta...
Definition: RawPostingList.h:19
PerDocBufferPtr buffer
Definition: TermVectorsTermsWriter.h:65
IndexOutputPtr tvf
Definition: TermVectorsTermsWriter.h:30
boost::weak_ptr< TermVectorsTermsWriter > TermVectorsTermsWriterWeakPtr
Definition: LuceneTypes.h:258
boost::weak_ptr< DocumentsWriter > DocumentsWriterWeakPtr
Definition: LuceneTypes.h:123
void addField(int32_t fieldNumber)
virtual TermsHashConsumerPerThreadPtr addThread(const TermsHashPerThreadPtr &perThread)
IndexOutputPtr tvd
Definition: TermVectorsTermsWriter.h:29
int32_t lastOffset
Definition: TermVectorsTermsWriter.h:89
boost::shared_ptr< DocumentsWriter > DocumentsWriterPtr
Definition: LuceneTypes.h:123
boost::shared_ptr< TermVectorsWriter > TermVectorsWriterPtr
Definition: LuceneTypes.h:263
RAMOutputStreamPtr perDocTvf
Definition: TermVectorsTermsWriter.h:66
TermVectorsTermsWriterPerDocPtr getPerDoc()
Definition: TermVectorsTermsWriter.h:54
Collection< int64_t > fieldPointers
Definition: TermVectorsTermsWriter.h:70
Collection< TermVectorsTermsWriterPerDocPtr > docFreeList
Definition: TermVectorsTermsWriter.h:26
virtual int32_t bytesPerPosting()
int32_t lastDocID
Definition: TermVectorsTermsWriter.h:31
boost::shared_ptr< TermVectorsTermsWriter > TermVectorsTermsWriterPtr
Definition: LuceneTypes.h:258
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Definition: AbstractAllTermDocs.h:12
Definition: TermVectorsTermsWriter.h:16
TermVectorsWriterPtr termVectorsWriter
Definition: TermVectorsTermsWriter.h:25
void finishDocument(const TermVectorsTermsWriterPerDocPtr &perDoc)
Collection< int32_t > fieldNumbers
Definition: TermVectorsTermsWriter.h:69
TermVectorsTermsWriter(const DocumentsWriterPtr &docWriter)
int32_t lastPosition
Definition: TermVectorsTermsWriter.h:90
boost::shared_ptr< RAMOutputStream > RAMOutputStreamPtr
Definition: LuceneTypes.h:508
Definition: TermVectorsTermsWriter.h:80
boost::shared_ptr< TermsHashPerThread > TermsHashPerThreadPtr
Definition: LuceneTypes.h:251
int32_t numVectorFields
Definition: TermVectorsTermsWriter.h:67
boost::shared_ptr< TermVectorsTermsWriterPerDoc > TermVectorsTermsWriterPerDocPtr
Definition: LuceneTypes.h:259
int32_t freq
Definition: TermVectorsTermsWriter.h:85
Consumer returns this on each doc. This holds any state that must be flushed synchronized "in docID o...
Definition: DocumentsWriter.h:402
boost::shared_ptr< PerDocBuffer > PerDocBufferPtr
Definition: LuceneTypes.h:199
int32_t allocCount
Definition: TermVectorsTermsWriter.h:32
TermVectorsTermsWriterPerDoc(const TermVectorsTermsWriterPtr &termsWriter=TermVectorsTermsWriterPtr())
virtual void closeDocStore(const SegmentWriteStatePtr &state)
boost::shared_ptr< SegmentWriteState > SegmentWriteStatePtr
Definition: LuceneTypes.h:222
int32_t freeCount
Definition: TermVectorsTermsWriter.h:27
virtual void createPostings(Collection< RawPostingListPtr > postings, int32_t start, int32_t count)
TermVectorsTermsWriterWeakPtr _termsWriter
Definition: TermVectorsTermsWriter.h:59

clucene.sourceforge.net