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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PositionBasedTermVectorMapper.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 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);
52  virtual ~TermVectorsPositionInfo();
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 
69  Collection<String> getTerms();
70 
75 };
76 
77 }
78 
79 #endif

clucene.sourceforge.net