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


Loading...
Searching...
No Matches
SegmentTermPositions.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 SEGMENTTERMPOSITIONS_H
8#define SEGMENTTERMPOSITIONS_H
9
10#include "SegmentTermDocs.h"
11
12namespace Lucene {
13
15public:
18
20
21protected:
23 int32_t proxCount;
24 int32_t position;
25
28
31
32 // these variables are being used to remember information for a lazy skip
35
36public:
37 using SegmentTermDocs::seek;
38
39 virtual void seek(const TermInfoPtr& ti, const TermPtr& term);
40 virtual void close();
41
43 virtual int32_t nextPosition();
44
46 virtual bool next();
47
49 virtual int32_t read(Collection<int32_t>& docs, Collection<int32_t>& freqs);
50
52 virtual int32_t getPayloadLength();
53
55 virtual ByteArray getPayload(ByteArray data, int32_t offset);
56
58 virtual bool isPayloadAvailable();
59
60protected:
62
63 virtual void skippingDoc();
64
65 virtual void skipProx(int64_t proxPointer, int32_t payloadLength);
66 virtual void skipPositions(int32_t n);
67 virtual void skipPayload();
68
75 virtual void lazySkip();
76};
77
78}
79
80#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 SegmentTermDocs.h:14
Definition SegmentTermPositions.h:14
virtual bool next()
Moves to the next pair in the enumeration.
virtual int32_t getPayloadLength()
Returns the length of the payload at the current term position.
virtual void seek(const TermInfoPtr &ti, const TermPtr &term)
virtual void close()
Frees associated resources.
int32_t payloadLength
The current payload length.
Definition SegmentTermPositions.h:27
SegmentTermPositions(const SegmentReaderPtr &parent)
IndexInputPtr proxStream
Definition SegmentTermPositions.h:22
virtual bool isPayloadAvailable()
Checks if a payload can be loaded at this position.
virtual ByteArray getPayload(ByteArray data, int32_t offset)
Returns the payload data at the current term position.
virtual int32_t read(Collection< int32_t > &docs, Collection< int32_t > &freqs)
Not supported.
virtual void skipPositions(int32_t n)
virtual void lazySkip()
It is not always necessary to move the prox pointer to a new document after the freq pointer has been...
int64_t lazySkipPointer
Definition SegmentTermPositions.h:33
bool needToLoadPayload
Indicates whether the payload of the current position has been read from the proxStream yet.
Definition SegmentTermPositions.h:30
int32_t lazySkipProxCount
Definition SegmentTermPositions.h:34
int32_t proxCount
Definition SegmentTermPositions.h:23
virtual void skipProx(int64_t proxPointer, int32_t payloadLength)
Overridden by SegmentTermPositions to skip in prox stream.
int32_t position
Definition SegmentTermPositions.h:24
virtual int32_t nextPosition()
Returns next position in the current document.
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< Term > TermPtr
Definition LuceneTypes.h:233
boost::shared_ptr< IndexInput > IndexInputPtr
Definition LuceneTypes.h:493
boost::shared_ptr< TermInfo > TermInfoPtr
Definition LuceneTypes.h:239
boost::shared_ptr< SegmentReader > SegmentReaderPtr
Definition LuceneTypes.h:215

clucene.sourceforge.net