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

SegmentTermPositions.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 SEGMENTTERMPOSITIONS_H
8 #define SEGMENTTERMPOSITIONS_H
9
10 #include "SegmentTermDocs.h"
11
12 namespace Lucene {
13
14 class SegmentTermPositions : public SegmentTermDocs {
15 public:
16 SegmentTermPositions(const SegmentReaderPtr& parent);
17 virtual ~SegmentTermPositions();
18
19 LUCENE_CLASS(SegmentTermPositions);
20
21 protected:
22 IndexInputPtr proxStream;
23 int32_t proxCount;
24 int32_t position;
25
27 int32_t payloadLength;
28
30 bool needToLoadPayload;
31
32 // these variables are being used to remember information for a lazy skip
33 int64_t lazySkipPointer;
34 int32_t lazySkipProxCount;
35
36 public:
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
60 protected:
61 int32_t readDeltaPosition();
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
Lucene::SegmentTermPositions::proxCount
int32_t proxCount
Definition: SegmentTermPositions.h:23
Lucene::SegmentTermPositions::skipPayload
virtual void skipPayload()
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::SegmentTermPositions
Definition: SegmentTermPositions.h:14
Lucene::TermPtr
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233
Lucene::SegmentTermPositions::readDeltaPosition
int32_t readDeltaPosition()
Lucene::Collection< int32_t >
Lucene::SegmentTermPositions::proxStream
IndexInputPtr proxStream
Definition: SegmentTermPositions.h:19
Lucene::SegmentTermDocs
Definition: SegmentTermDocs.h:14
Lucene::SegmentTermPositions::lazySkipPointer
int64_t lazySkipPointer
Definition: SegmentTermPositions.h:33
Lucene::SegmentTermPositions::nextPosition
virtual int32_t nextPosition()
Returns next position in the current document.
Lucene::SegmentTermPositions::skippingDoc
virtual void skippingDoc()
Lucene::SegmentTermPositions::lazySkip
virtual void lazySkip()
It is not always necessary to move the prox pointer to a new document after the freq pointer has been...
Lucene::SegmentTermPositions::skipProx
virtual void skipProx(int64_t proxPointer, int32_t payloadLength)
Overridden by SegmentTermPositions to skip in prox stream.
Lucene::SegmentReaderPtr
boost::shared_ptr< SegmentReader > SegmentReaderPtr
Definition: LuceneTypes.h:215
Lucene::SegmentTermPositions::~SegmentTermPositions
virtual ~SegmentTermPositions()
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::SegmentTermPositions::skipPositions
virtual void skipPositions(int32_t n)
Lucene::SegmentTermPositions::getPayload
virtual ByteArray getPayload(ByteArray data, int32_t offset)
Returns the payload data at the current term position.
Lucene::SegmentTermPositions::lazySkipProxCount
int32_t lazySkipProxCount
Definition: SegmentTermPositions.h:34
SegmentTermDocs.h
Lucene::IndexInputPtr
boost::shared_ptr< IndexInput > IndexInputPtr
Definition: LuceneTypes.h:493
Lucene::SegmentTermPositions::read
virtual int32_t read(Collection< int32_t > docs, Collection< int32_t > freqs)
Not supported.
Lucene::TermInfoPtr
boost::shared_ptr< TermInfo > TermInfoPtr
Definition: LuceneTypes.h:239
Lucene::SegmentTermPositions::position
int32_t position
Definition: SegmentTermPositions.h:24
Lucene::SegmentTermPositions::payloadLength
int32_t payloadLength
The current payload length.
Definition: SegmentTermPositions.h:27
Lucene::SegmentTermPositions::SegmentTermPositions
SegmentTermPositions(const SegmentReaderPtr &parent)
Lucene::SegmentTermPositions::isPayloadAvailable
virtual bool isPayloadAvailable()
Checks if a payload can be loaded at this position.
Lucene::SegmentTermPositions::seek
virtual void seek(const TermInfoPtr &ti, const TermPtr &term)
Lucene::SegmentTermPositions::next
virtual bool next()
Moves to the next pair in the enumeration.
Lucene::SegmentTermPositions::close
virtual void close()
Frees associated resources.
Lucene::SegmentTermPositions::getPayloadLength
virtual int32_t getPayloadLength()
Returns the length of the payload at the current term position.
Lucene::SegmentTermDocs::seek
virtual void seek(const TermPtr &term)
Sets this to the data for a term.
Lucene::SegmentTermPositions::needToLoadPayload
bool needToLoadPayload
Indicates whether the payload of the current position has been read from the proxStream yet.
Definition: SegmentTermPositions.h:30

clucene.sourceforge.net