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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 
12 namespace Lucene {
13 
15 public:
17  virtual ~TermsHashPerField();
18 
20 
21 public:
30 
31  // Copied from our perThread
35 
36  int32_t streamCount;
37  int32_t numPostingInt;
38 
40 
42  int32_t numPostings;
43 
44  IntArray intUptos;
45  int32_t intUptoStart;
46 
47 protected:
53  bool doCall;
54  bool doNextCall;
55 
56 public:
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 
90 protected:
91  void compactPostings();
92 
94  bool postingEquals(const wchar_t* tokenText, int32_t tokenTextLen);
95 };
96 
97 }
98 
99 #endif

clucene.sourceforge.net