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

TermSpans.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 TERMSPANS_H
8 #define TERMSPANS_H
9
10 #include "Spans.h"
11
12 namespace Lucene {
13
15 class LPPAPI TermSpans : public Spans {
16 public:
17 TermSpans(const TermPositionsPtr& positions, const TermPtr& term);
18 virtual ~TermSpans();
19
20 LUCENE_CLASS(TermSpans);
21
22 protected:
23 TermPositionsPtr positions;
24 TermPtr term;
25 int32_t _doc;
26 int32_t freq;
27 int32_t count;
28 int32_t position;
29
30 public:
31 virtual bool next();
32 virtual bool skipTo(int32_t target);
33 virtual int32_t doc();
34 virtual int32_t start();
35 virtual int32_t end();
36 virtual Collection<ByteArray> getPayload();
37 virtual bool isPayloadAvailable();
38 virtual String toString();
39
40 TermPositionsPtr getPositions();
41 };
42
43 }
44
45 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Spans.h
Lucene::Collection< ByteArray >
Lucene::Spans
An enumeration of span matches. Used to implement span searching. Each span represents a range of ter...
Definition: Spans.h:17
Lucene::TermSpans
Public for extension only.
Definition: TermSpans.h:15
Lucene::TermSpans::term
TermPtr term
Definition: TermSpans.h:24
Lucene::TermSpans::end
virtual int32_t end()
Returns the end position of the current match. Initially invalid.
Lucene::TermSpans::position
int32_t position
Definition: TermSpans.h:28
Lucene::TermSpans::positions
TermPositionsPtr positions
Definition: TermSpans.h:20
Lucene::TermSpans::_doc
int32_t _doc
Definition: TermSpans.h:25
Lucene::TermSpans::freq
int32_t freq
Definition: TermSpans.h:26
Lucene::TermSpans::skipTo
virtual bool skipTo(int32_t target)
Skips to the first match beyond the current, whose document number is greater than or equal to target...
Lucene::TermSpans::~TermSpans
virtual ~TermSpans()
Lucene::TermSpans::doc
virtual int32_t doc()
Returns the document number of the current match. Initially invalid.
Lucene::TermSpans::TermSpans
TermSpans(const TermPositionsPtr &positions, const TermPtr &term)
Lucene::TermSpans::start
virtual int32_t start()
Returns the start position of the current match. Initially invalid.
Lucene::TermSpans::next
virtual bool next()
Move to the next match, returning true if any such exists.
Lucene::TermSpans::toString
virtual String toString()
Returns a string representation of the object.
Lucene::TermSpans::getPayload
virtual Collection< ByteArray > getPayload()
Returns the payload data for the current span. This is invalid until next() is called for the first t...
Lucene::TermSpans::getPositions
TermPositionsPtr getPositions()
Lucene::TermSpans::count
int32_t count
Definition: TermSpans.h:27
Lucene::TermSpans::isPayloadAvailable
virtual bool isPayloadAvailable()
Checks if a payload can be loaded at this position.
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::TermPositionsPtr
boost::shared_ptr< TermPositions > TermPositionsPtr
Definition: LuceneTypes.h:243
Lucene::TermPtr
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233

clucene.sourceforge.net