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

Loading...
Searching...
No Matches
TermVectorsTermsWriter.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 TERMVECTORSTERMSWRITER_H
8#define TERMVECTORSTERMSWRITER_H
9
10#include "TermsHashConsumer.h"
11#include "DocumentsWriter.h"
12#include "RawPostingList.h"
13
14 namespace Lucene {
15
16 class TermVectorsTermsWriter : public TermsHashConsumer {
17 public:
18 TermVectorsTermsWriter(const DocumentsWriterPtr& docWriter);
19 virtual ~TermVectorsTermsWriter();
20
21 LUCENE_CLASS(TermVectorsTermsWriter);
22
23 public:
24 DocumentsWriterWeakPtr _docWriter;
25 TermVectorsWriterPtr termVectorsWriter;
26 Collection<TermVectorsTermsWriterPerDocPtr> docFreeList;
27 int32_t freeCount;
28 IndexOutputPtr tvx;
29 IndexOutputPtr tvd;
30 IndexOutputPtr tvf;
31 int32_t lastDocID;
32 int32_t allocCount;
33
34 public:
35 virtual TermsHashConsumerPerThreadPtr addThread(const TermsHashPerThreadPtr& perThread);
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
40 TermVectorsTermsWriterPerDocPtr getPerDoc();
41
43 void fill(int32_t docID);
44
45 void initTermVectorsWriter();
46 void finishDocument(const TermVectorsTermsWriterPerDocPtr& perDoc);
47 bool freeRAM();
48 void free(const TermVectorsTermsWriterPerDocPtr& doc);
49
50 virtual void abort();
51 virtual int32_t bytesPerPosting();
52};
53
54 class TermVectorsTermsWriterPerDoc : public DocWriter {
55 public:
56 TermVectorsTermsWriterPerDoc(const TermVectorsTermsWriterPtr& termsWriter = TermVectorsTermsWriterPtr());
57 virtual ~TermVectorsTermsWriterPerDoc();
58
59 LUCENE_CLASS(TermVectorsTermsWriterPerDoc);
60
61 protected:
62 TermVectorsTermsWriterWeakPtr _termsWriter;
63
64 public:
65 PerDocBufferPtr buffer;
66 RAMOutputStreamPtr perDocTvf;
67 int32_t numVectorFields;
68
69 Collection<int32_t> fieldNumbers;
70 Collection<int64_t> fieldPointers;
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
80 class TermVectorsTermsWriterPostingList : public RawPostingList {
81 public:
82 TermVectorsTermsWriterPostingList();
83 virtual ~TermVectorsTermsWriterPostingList();
84
85 LUCENE_CLASS(TermVectorsTermsWriterPostingList);
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
DocumentsWriter.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
RawPostingList.h
TermsHashConsumer.h
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::DocWriter
Consumer returns this on each doc. This holds any state that must be flushed synchronized "in docID o...
Definition DocumentsWriter.h:402
Lucene::RawPostingList
This is the base class for an in-memory posting list, keyed by a Token. TermsHash maintains a hash ta...
Definition RawPostingList.h:19
Lucene::TermVectorsTermsWriterPerDoc
Definition TermVectorsTermsWriter.h:54
Lucene::TermVectorsTermsWriterPerDoc::TermVectorsTermsWriterPerDoc
TermVectorsTermsWriterPerDoc(const TermVectorsTermsWriterPtr &termsWriter=TermVectorsTermsWriterPtr())
Lucene::TermVectorsTermsWriterPerDoc::addField
void addField(int32_t fieldNumber)
Lucene::TermVectorsTermsWriterPerDoc::abort
virtual void abort()
Lucene::TermVectorsTermsWriterPerDoc::buffer
PerDocBufferPtr buffer
Definition TermVectorsTermsWriter.h:65
Lucene::TermVectorsTermsWriterPerDoc::fieldPointers
Collection< int64_t > fieldPointers
Definition TermVectorsTermsWriter.h:70
Lucene::TermVectorsTermsWriterPerDoc::~TermVectorsTermsWriterPerDoc
virtual ~TermVectorsTermsWriterPerDoc()
Lucene::TermVectorsTermsWriterPerDoc::perDocTvf
RAMOutputStreamPtr perDocTvf
Definition TermVectorsTermsWriter.h:66
Lucene::TermVectorsTermsWriterPerDoc::reset
void reset()
Lucene::TermVectorsTermsWriterPerDoc::fieldNumbers
Collection< int32_t > fieldNumbers
Definition TermVectorsTermsWriter.h:69
Lucene::TermVectorsTermsWriterPerDoc::_termsWriter
TermVectorsTermsWriterWeakPtr _termsWriter
Definition TermVectorsTermsWriter.h:62
Lucene::TermVectorsTermsWriterPerDoc::sizeInBytes
virtual int64_t sizeInBytes()
Lucene::TermVectorsTermsWriterPerDoc::finish
virtual void finish()
Lucene::TermVectorsTermsWriterPerDoc::numVectorFields
int32_t numVectorFields
Definition TermVectorsTermsWriter.h:67
Lucene::TermVectorsTermsWriterPostingList
Definition TermVectorsTermsWriter.h:80
Lucene::TermVectorsTermsWriterPostingList::freq
int32_t freq
Definition TermVectorsTermsWriter.h:88
Lucene::TermVectorsTermsWriterPostingList::lastOffset
int32_t lastOffset
Definition TermVectorsTermsWriter.h:89
Lucene::TermVectorsTermsWriterPostingList::lastPosition
int32_t lastPosition
Definition TermVectorsTermsWriter.h:90
Lucene::TermVectorsTermsWriterPostingList::TermVectorsTermsWriterPostingList
TermVectorsTermsWriterPostingList()
Lucene::TermVectorsTermsWriterPostingList::~TermVectorsTermsWriterPostingList
virtual ~TermVectorsTermsWriterPostingList()
Lucene::TermVectorsTermsWriter
Definition TermVectorsTermsWriter.h:16
Lucene::TermVectorsTermsWriter::docFreeList
Collection< TermVectorsTermsWriterPerDocPtr > docFreeList
Definition TermVectorsTermsWriter.h:26
Lucene::TermVectorsTermsWriter::createPostings
virtual void createPostings(Collection< RawPostingListPtr > postings, int32_t start, int32_t count)
Lucene::TermVectorsTermsWriter::fill
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.
Lucene::TermVectorsTermsWriter::flush
virtual void flush(MapTermsHashConsumerPerThreadCollectionTermsHashConsumerPerField threadsAndFields, const SegmentWriteStatePtr &state)
Lucene::TermVectorsTermsWriter::abort
virtual void abort()
Lucene::TermVectorsTermsWriter::termVectorsWriter
TermVectorsWriterPtr termVectorsWriter
Definition TermVectorsTermsWriter.h:25
Lucene::TermVectorsTermsWriter::tvd
IndexOutputPtr tvd
Definition TermVectorsTermsWriter.h:29
Lucene::TermVectorsTermsWriter::lastDocID
int32_t lastDocID
Definition TermVectorsTermsWriter.h:31
Lucene::TermVectorsTermsWriter::free
void free(const TermVectorsTermsWriterPerDocPtr &doc)
Lucene::TermVectorsTermsWriter::allocCount
int32_t allocCount
Definition TermVectorsTermsWriter.h:32
Lucene::TermVectorsTermsWriter::tvx
IndexOutputPtr tvx
Definition TermVectorsTermsWriter.h:28
Lucene::TermVectorsTermsWriter::closeDocStore
virtual void closeDocStore(const SegmentWriteStatePtr &state)
Lucene::TermVectorsTermsWriter::TermVectorsTermsWriter
TermVectorsTermsWriter(const DocumentsWriterPtr &docWriter)
Lucene::TermVectorsTermsWriter::finishDocument
void finishDocument(const TermVectorsTermsWriterPerDocPtr &perDoc)
Lucene::TermVectorsTermsWriter::bytesPerPosting
virtual int32_t bytesPerPosting()
Lucene::TermVectorsTermsWriter::initTermVectorsWriter
void initTermVectorsWriter()
Lucene::TermVectorsTermsWriter::~TermVectorsTermsWriter
virtual ~TermVectorsTermsWriter()
Lucene::TermVectorsTermsWriter::tvf
IndexOutputPtr tvf
Definition TermVectorsTermsWriter.h:30
Lucene::TermVectorsTermsWriter::_docWriter
DocumentsWriterWeakPtr _docWriter
Definition TermVectorsTermsWriter.h:24
Lucene::TermVectorsTermsWriter::freeRAM
bool freeRAM()
Lucene::TermVectorsTermsWriter::getPerDoc
TermVectorsTermsWriterPerDocPtr getPerDoc()
Lucene::TermVectorsTermsWriter::freeCount
int32_t freeCount
Definition TermVectorsTermsWriter.h:27
Lucene::TermVectorsTermsWriter::addThread
virtual TermsHashConsumerPerThreadPtr addThread(const TermsHashPerThreadPtr &perThread)
Lucene::TermsHashConsumer
Definition TermsHashConsumer.h:14
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::TermVectorsTermsWriterWeakPtr
boost::weak_ptr< TermVectorsTermsWriter > TermVectorsTermsWriterWeakPtr
Definition LuceneTypes.h:258
Lucene::TermVectorsWriterPtr
boost::shared_ptr< TermVectorsWriter > TermVectorsWriterPtr
Definition LuceneTypes.h:263
Lucene::TermsHashConsumerPerThreadPtr
boost::shared_ptr< TermsHashConsumerPerThread > TermsHashConsumerPerThreadPtr
Definition LuceneTypes.h:249
Lucene::TermVectorsTermsWriterPtr
boost::shared_ptr< TermVectorsTermsWriter > TermVectorsTermsWriterPtr
Definition LuceneTypes.h:258
Lucene::DocumentsWriterPtr
boost::shared_ptr< DocumentsWriter > DocumentsWriterPtr
Definition LuceneTypes.h:123
Lucene::SegmentWriteStatePtr
boost::shared_ptr< SegmentWriteState > SegmentWriteStatePtr
Definition LuceneTypes.h:222
Lucene::DocumentsWriterWeakPtr
boost::weak_ptr< DocumentsWriter > DocumentsWriterWeakPtr
Definition LuceneTypes.h:123
Lucene::TermVectorsTermsWriterPerDocPtr
boost::shared_ptr< TermVectorsTermsWriterPerDoc > TermVectorsTermsWriterPerDocPtr
Definition LuceneTypes.h:259
Lucene::TermsHashPerThreadPtr
boost::shared_ptr< TermsHashPerThread > TermsHashPerThreadPtr
Definition LuceneTypes.h:251
Lucene::IndexOutputPtr
boost::shared_ptr< IndexOutput > IndexOutputPtr
Definition LuceneTypes.h:494
Lucene::PerDocBufferPtr
boost::shared_ptr< PerDocBuffer > PerDocBufferPtr
Definition LuceneTypes.h:199
Lucene::RAMOutputStreamPtr
boost::shared_ptr< RAMOutputStream > RAMOutputStreamPtr
Definition LuceneTypes.h:508

clucene.sourceforge.net