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 // Copyright (c) 2009-2011 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  {
16  public:
17  PositionBasedTermVectorMapper(bool ignoringOffsets = false);
19 
21 
22  protected:
23  MapStringMapIntTermVectorsPositionInfo fieldToTerms;
24 
25  String currentField;
26 
28  MapIntTermVectorsPositionInfo currentPositions;
29 
31 
32  public:
35  virtual bool isIgnoringPositions();
36 
38  virtual void map(const String& term, int32_t frequency, Collection<TermVectorOffsetInfoPtr> offsets, Collection<int32_t> positions);
39 
41  virtual void setExpectations(const String& field, int32_t numTerms, bool storeOffsets, bool storePositions);
42 
46  MapStringMapIntTermVectorsPositionInfo getFieldToTerms();
47  };
48 
50  class LPPAPI TermVectorsPositionInfo : public LuceneObject
51  {
52  public:
53  TermVectorsPositionInfo(int32_t position, bool storeOffsets);
54  virtual ~TermVectorsPositionInfo();
55 
57 
58  protected:
59  int32_t position;
62 
63  public:
64  void addTerm(const String& term, TermVectorOffsetInfoPtr info);
65 
67  int32_t getPosition();
68 
71  Collection<String> getTerms();
72 
77  };
78 }
79 
80 #endif

clucene.sourceforge.net