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 
15 public:
16  PositionBasedTermVectorMapper(bool ignoringOffsets = false);
18 
20 
21 protected:
22  MapStringMapIntTermVectorsPositionInfo fieldToTerms;
23 
24  String currentField;
25 
27  MapIntTermVectorsPositionInfo currentPositions;
28 
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);
53 
55 
56 protected:
57  int32_t position;
60 
61 public:
62  void addTerm(const String& term, const TermVectorOffsetInfoPtr& info);
63 
65  int32_t getPosition();
66 
70 
75 };
76 
77 }
78 
79 #endif
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Definition: PositionBasedTermVectorMapper.h:14
virtual bool isIgnoringPositions()
Never ignores positions. This mapper doesn't make much sense unless there are positions.
virtual void map(const String &term, int32_t frequency, Collection< TermVectorOffsetInfoPtr > offsets, Collection< int32_t > positions)
Callback for the TermVectorReader.
String currentField
Definition: PositionBasedTermVectorMapper.h:24
PositionBasedTermVectorMapper(bool ignoringOffsets=false)
MapStringMapIntTermVectorsPositionInfo getFieldToTerms()
Get the mapping between fields and terms, sorted by the comparator.
MapStringMapIntTermVectorsPositionInfo fieldToTerms
Definition: PositionBasedTermVectorMapper.h:19
virtual void setExpectations(const String &field, int32_t numTerms, bool storeOffsets, bool storePositions)
Callback mechanism used by the TermVectorReader.
MapIntTermVectorsPositionInfo currentPositions
A Map of Integer and TermVectorsPositionInfo.
Definition: PositionBasedTermVectorMapper.h:27
bool storeOffsets
Definition: PositionBasedTermVectorMapper.h:29
The TermVectorMapper can be used to map Term Vectors into your own structure instead of the parallel ...
Definition: TermVectorMapper.h:18
Container for a term at a position.
Definition: PositionBasedTermVectorMapper.h:49
Collection< TermVectorOffsetInfoPtr > getOffsets()
Parallel list (to getTerms()) of TermVectorOffsetInfo objects. There may be multiple entries since th...
Collection< String > getTerms()
Note, there may be multiple terms at the same position.
void addTerm(const String &term, const TermVectorOffsetInfoPtr &info)
int32_t position
Definition: PositionBasedTermVectorMapper.h:54
Collection< TermVectorOffsetInfoPtr > offsets
Definition: PositionBasedTermVectorMapper.h:59
Collection< String > terms
Definition: PositionBasedTermVectorMapper.h:58
TermVectorsPositionInfo(int32_t position, bool storeOffsets)
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< TermVectorOffsetInfo > TermVectorOffsetInfoPtr
Definition: LuceneTypes.h:255

clucene.sourceforge.net