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

PositionBasedTermVectorMapper.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 POSITIONBASEDTERMVECTORMAPPER_H
8 #define POSITIONBASEDTERMVECTORMAPPER_H
9
10 #include "TermVectorMapper.h"
11
12 namespace Lucene {
13
14 class LPPAPI PositionBasedTermVectorMapper : public TermVectorMapper {
15 public:
16 PositionBasedTermVectorMapper(bool ignoringOffsets = false);
17 virtual ~PositionBasedTermVectorMapper();
18
19 LUCENE_CLASS(PositionBasedTermVectorMapper);
20
21 protected:
22 MapStringMapIntTermVectorsPositionInfo fieldToTerms;
23
24 String currentField;
25
27 MapIntTermVectorsPositionInfo currentPositions;
28
29 bool storeOffsets;
30
31 public:
34 virtual bool isIgnoringPositions();
35
37 virtual void map(const String& term, int32_t frequency, Collection<TermVectorOffsetInfoPtr> offsets, Collection<int32_t> positions);
38
40 virtual void setExpectations(const String& field, int32_t numTerms, bool storeOffsets, bool storePositions);
41
45 MapStringMapIntTermVectorsPositionInfo getFieldToTerms();
46 };
47
49 class LPPAPI TermVectorsPositionInfo : public LuceneObject {
50 public:
51 TermVectorsPositionInfo(int32_t position, bool storeOffsets);
52 virtual ~TermVectorsPositionInfo();
53
54 LUCENE_CLASS(TermVectorsPositionInfo);
55
56 protected:
57 int32_t position;
58 Collection<String> terms;
59 Collection<TermVectorOffsetInfoPtr> offsets;
60
61 public:
62 void addTerm(const String& term, const TermVectorOffsetInfoPtr& info);
63
65 int32_t getPosition();
66
69 Collection<String> getTerms();
70
74 Collection<TermVectorOffsetInfoPtr> getOffsets();
75 };
76
77 }
78
79 #endif
Lucene::PositionBasedTermVectorMapper::currentPositions
MapIntTermVectorsPositionInfo currentPositions
A Map of Integer and TermVectorsPositionInfo.
Definition: PositionBasedTermVectorMapper.h:27
Lucene::PositionBasedTermVectorMapper::storeOffsets
bool storeOffsets
Definition: PositionBasedTermVectorMapper.h:29
Lucene::TermVectorsPositionInfo
Container for a term at a position.
Definition: PositionBasedTermVectorMapper.h:49
Lucene::TermVectorsPositionInfo::terms
Collection< String > terms
Definition: PositionBasedTermVectorMapper.h:58
TermVectorMapper.h
Lucene::PositionBasedTermVectorMapper
Definition: PositionBasedTermVectorMapper.h:14
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::TermVectorsPositionInfo::offsets
Collection< TermVectorOffsetInfoPtr > offsets
Definition: PositionBasedTermVectorMapper.h:59
Lucene::TermVectorMapper
The TermVectorMapper can be used to map Term Vectors into your own structure instead of the parallel ...
Definition: TermVectorMapper.h:18
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::TermVectorOffsetInfoPtr
boost::shared_ptr< TermVectorOffsetInfo > TermVectorOffsetInfoPtr
Definition: LuceneTypes.h:255
Lucene::PositionBasedTermVectorMapper::currentField
String currentField
Definition: PositionBasedTermVectorMapper.h:24
Lucene::Collection< TermVectorOffsetInfoPtr >

clucene.sourceforge.net