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


Loading...
Searching...
No Matches
TermsHashPerField.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 TERMSHASHPERFIELD_H
8#define TERMSHASHPERFIELD_H
9
11
12namespace Lucene {
13
15public:
18
20
21public:
30
31 // Copied from our perThread
35
36 int32_t streamCount;
38
40
42 int32_t numPostings;
43
44 IntArray intUptos;
45 int32_t intUptoStart;
46
47protected:
53 bool doCall;
55
56public:
57 virtual void initialize();
58 void shrinkHash(int32_t targetSize);
59 void reset();
60
62 virtual void abort();
63
64 void initReader(const ByteSliceReaderPtr& reader, const RawPostingListPtr& p, int32_t stream);
65
68
70 virtual void start(const FieldablePtr& field);
71
73 virtual bool start(Collection<FieldablePtr> fields, int32_t count);
74
75 void add(int32_t textStart);
76
78 virtual void add();
79
80 void writeByte(int32_t stream, int8_t b);
81 void writeBytes(int32_t stream, const uint8_t* b, int32_t offset, int32_t length);
82 void writeVInt(int32_t stream, int32_t i);
83
85 virtual void finish();
86
88 void rehashPostings(int32_t newSize);
89
90protected:
92
94 bool postingEquals(const wchar_t* tokenText, int32_t tokenTextLen);
95};
96
97}
98
99#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Definition InvertedDocConsumerPerField.h:14
Definition TermsHashPerField.h:14
FieldInfoPtr fieldInfo
Definition TermsHashPerField.h:39
void writeVInt(int32_t stream, int32_t i)
virtual void abort()
Called on hitting an aborting exception.
RawPostingListPtr p
Definition TermsHashPerField.h:52
int32_t postingsHashHalfSize
Definition TermsHashPerField.h:49
virtual void start(const FieldablePtr &field)
Called before a field instance is being processed.
virtual void initialize()
Called directly after instantiation to create objects that depend on this object being fully construc...
CharBlockPoolPtr charPool
Definition TermsHashPerField.h:32
int32_t postingsHashMask
Definition TermsHashPerField.h:50
virtual bool start(Collection< FieldablePtr > fields, int32_t count)
Called once per field, and is given all Fieldable occurrences for this field in the document.
Collection< RawPostingListPtr > postingsHash
Definition TermsHashPerField.h:51
bool doNextCall
Definition TermsHashPerField.h:54
int32_t intUptoStart
Definition TermsHashPerField.h:45
void add(int32_t textStart)
IntArray intUptos
Definition TermsHashPerField.h:44
ByteBlockPoolPtr bytePool
Definition TermsHashPerField.h:34
TermsHashPerThreadPtr nextPerThread
Definition TermsHashPerField.h:25
Collection< RawPostingListPtr > sortPostings()
Collapse the hash table and sort in-place.
int32_t numPostingInt
Definition TermsHashPerField.h:37
virtual void finish()
Called once per field per document, after all Fieldable occurrences are inverted.
DocStatePtr docState
Definition TermsHashPerField.h:27
IntBlockPoolPtr intPool
Definition TermsHashPerField.h:33
TermAttributePtr termAtt
Definition TermsHashPerField.h:29
bool postingsCompacted
Definition TermsHashPerField.h:41
TermsHashPerThreadWeakPtr _perThread
Definition TermsHashPerField.h:26
int32_t postingsHashSize
Definition TermsHashPerField.h:48
void writeBytes(int32_t stream, const uint8_t *b, int32_t offset, int32_t length)
int32_t streamCount
Definition TermsHashPerField.h:36
int32_t numPostings
Definition TermsHashPerField.h:42
TermsHashConsumerPerFieldPtr consumer
Definition TermsHashPerField.h:22
void shrinkHash(int32_t targetSize)
void initReader(const ByteSliceReaderPtr &reader, const RawPostingListPtr &p, int32_t stream)
TermsHashPerFieldPtr nextPerField
Definition TermsHashPerField.h:23
DocInverterPerFieldWeakPtr _docInverterPerField
Definition TermsHashPerField.h:24
TermsHashPerField(const DocInverterPerFieldPtr &docInverterPerField, const TermsHashPerThreadPtr &perThread, const TermsHashPerThreadPtr &nextPerThread, const FieldInfoPtr &fieldInfo)
virtual void add()
Primary entry point (for first TermsHash)
FieldInvertStatePtr fieldState
Definition TermsHashPerField.h:28
bool doCall
Definition TermsHashPerField.h:53
bool postingEquals(const wchar_t *tokenText, int32_t tokenTextLen)
Test whether the text for current RawPostingList p equals current tokenText.
void writeByte(int32_t stream, int8_t b)
void rehashPostings(int32_t newSize)
Called when postings hash is too small (> 50% occupied) or too large (< 20% occupied).
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< DocState > DocStatePtr
Definition LuceneTypes.h:122
boost::shared_ptr< DocInverterPerField > DocInverterPerFieldPtr
Definition LuceneTypes.h:120
boost::weak_ptr< DocInverterPerField > DocInverterPerFieldWeakPtr
Definition LuceneTypes.h:120
boost::shared_ptr< TermsHashConsumerPerField > TermsHashConsumerPerFieldPtr
Definition LuceneTypes.h:248
boost::shared_ptr< Fieldable > FieldablePtr
Definition LuceneTypes.h:76
boost::shared_ptr< FieldInvertState > FieldInvertStatePtr
Definition LuceneTypes.h:128
boost::shared_ptr< ByteSliceReader > ByteSliceReaderPtr
Definition LuceneTypes.h:91
boost::shared_ptr< IntBlockPool > IntBlockPoolPtr
Definition LuceneTypes.h:161
boost::shared_ptr< CharBlockPool > CharBlockPoolPtr
Definition LuceneTypes.h:93
boost::weak_ptr< TermsHashPerThread > TermsHashPerThreadWeakPtr
Definition LuceneTypes.h:251
boost::shared_ptr< ByteBlockPool > ByteBlockPoolPtr
Definition LuceneTypes.h:89
boost::shared_ptr< TermsHashPerThread > TermsHashPerThreadPtr
Definition LuceneTypes.h:251
boost::shared_ptr< TermAttribute > TermAttributePtr
Definition LuceneTypes.h:58
boost::shared_ptr< TermsHashPerField > TermsHashPerFieldPtr
Definition LuceneTypes.h:250
boost::shared_ptr< FieldInfo > FieldInfoPtr
Definition LuceneTypes.h:126
boost::shared_ptr< RawPostingList > RawPostingListPtr
Definition LuceneTypes.h:201

clucene.sourceforge.net