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


Loading...
Searching...
No Matches
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
12namespace Lucene {
13
15public:
16 PositionBasedTermVectorMapper(bool ignoringOffsets = false);
18
20
21protected:
22 MapStringMapIntTermVectorsPositionInfo fieldToTerms;
23
25
27 MapIntTermVectorsPositionInfo currentPositions;
28
30
31public:
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
76
77}
78
79#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
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:22
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...
void addTerm(const String &term, const TermVectorOffsetInfoPtr &info)
Collection< String > getTerms()
Note, there may be multiple terms at the same position.
int32_t position
Definition PositionBasedTermVectorMapper.h:57
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