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

PerFieldAnalyzerWrapper.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 PERFIELDANALYZERWRAPPER_H
8 #define PERFIELDANALYZERWRAPPER_H
9
10 #include "Analyzer.h"
11
12 namespace Lucene {
13
29 class LPPAPI PerFieldAnalyzerWrapper : public Analyzer {
30 public:
34 PerFieldAnalyzerWrapper(const AnalyzerPtr& defaultAnalyzer);
35
39 PerFieldAnalyzerWrapper(const AnalyzerPtr& defaultAnalyzer, MapStringAnalyzer fieldAnalyzers);
40
41 virtual ~PerFieldAnalyzerWrapper();
42
43 LUCENE_CLASS(PerFieldAnalyzerWrapper);
44
45 protected:
46 AnalyzerPtr defaultAnalyzer;
47 MapStringAnalyzer analyzerMap;
48
49 public:
53 void addAnalyzer(const String& fieldName, const AnalyzerPtr& analyzer);
54
55 virtual TokenStreamPtr tokenStream(const String& fieldName, const ReaderPtr& reader);
56 virtual TokenStreamPtr reusableTokenStream(const String& fieldName, const ReaderPtr& reader);
57
59 virtual int32_t getPositionIncrementGap(const String& fieldName);
60
62 virtual int32_t getOffsetGap(const FieldablePtr& field);
63
64 virtual String toString();
65 };
66
67 }
68
69 #endif
Analyzer.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::Analyzer
An Analyzer builds TokenStreams, which analyze text. It thus represents a policy for extracting index...
Definition: Analyzer.h:19
Lucene::PerFieldAnalyzerWrapper
This analyzer is used to facilitate scenarios where different fields require different analysis techn...
Definition: PerFieldAnalyzerWrapper.h:29
Lucene::PerFieldAnalyzerWrapper::reusableTokenStream
virtual TokenStreamPtr reusableTokenStream(const String &fieldName, const ReaderPtr &reader)
Creates a TokenStream that is allowed to be re-used from the previous time that the same thread calle...
Lucene::PerFieldAnalyzerWrapper::analyzerMap
MapStringAnalyzer analyzerMap
Definition: PerFieldAnalyzerWrapper.h:47
Lucene::PerFieldAnalyzerWrapper::getOffsetGap
virtual int32_t getOffsetGap(const FieldablePtr &field)
Return the offsetGap from the analyzer assigned to field.
Lucene::PerFieldAnalyzerWrapper::PerFieldAnalyzerWrapper
PerFieldAnalyzerWrapper(const AnalyzerPtr &defaultAnalyzer)
Constructs with default analyzer.
Lucene::PerFieldAnalyzerWrapper::tokenStream
virtual TokenStreamPtr tokenStream(const String &fieldName, const ReaderPtr &reader)
Creates a TokenStream which tokenizes all the text in the provided Reader. Must be able to handle nul...
Lucene::PerFieldAnalyzerWrapper::toString
virtual String toString()
Returns a string representation of the object.
Lucene::PerFieldAnalyzerWrapper::~PerFieldAnalyzerWrapper
virtual ~PerFieldAnalyzerWrapper()
Lucene::PerFieldAnalyzerWrapper::PerFieldAnalyzerWrapper
PerFieldAnalyzerWrapper(const AnalyzerPtr &defaultAnalyzer, MapStringAnalyzer fieldAnalyzers)
Constructs with default analyzer and a map of analyzers to use for specific fields.
Lucene::PerFieldAnalyzerWrapper::defaultAnalyzer
AnalyzerPtr defaultAnalyzer
Definition: PerFieldAnalyzerWrapper.h:43
Lucene::PerFieldAnalyzerWrapper::getPositionIncrementGap
virtual int32_t getPositionIncrementGap(const String &fieldName)
Return the positionIncrementGap from the analyzer assigned to fieldName.
Lucene::PerFieldAnalyzerWrapper::addAnalyzer
void addAnalyzer(const String &fieldName, const AnalyzerPtr &analyzer)
Defines an analyzer to use for the specified field.
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::FieldablePtr
boost::shared_ptr< Fieldable > FieldablePtr
Definition: LuceneTypes.h:76
Lucene::TokenStreamPtr
boost::shared_ptr< TokenStream > TokenStreamPtr
Definition: LuceneTypes.h:63
Lucene::AnalyzerPtr
boost::shared_ptr< Analyzer > AnalyzerPtr
Definition: LuceneTypes.h:20
Lucene::ReaderPtr
boost::shared_ptr< Reader > ReaderPtr
Definition: LuceneTypes.h:547

clucene.sourceforge.net