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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MultiFieldQueryParser.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 MULTIFIELDQUERYPARSER_H
8 #define MULTIFIELDQUERYPARSER_H
9
10 #include "QueryParser.h"
11 #include "BooleanClause.h"
12
13 namespace Lucene
14 {
16 class LPPAPI MultiFieldQueryParser : public QueryParser
17 {
18 public:
40 MultiFieldQueryParser(LuceneVersion::Version matchVersion, Collection<String> fields, AnalyzerPtr analyzer, MapStringDouble boosts);
41
56 MultiFieldQueryParser(LuceneVersion::Version matchVersion, Collection<String> fields, AnalyzerPtr analyzer);
57
58 virtual ~MultiFieldQueryParser();
59
60 LUCENE_CLASS(MultiFieldQueryParser);
61
62 protected:
63 Collection<String> fields;
64 MapStringDouble boosts;
65
66 public:
67 using QueryParser::parse;
68
79 static QueryPtr parse(LuceneVersion::Version matchVersion, Collection<String> queries, Collection<String> fields, AnalyzerPtr analyzer);
80
101 static QueryPtr parse(LuceneVersion::Version matchVersion, const String& query, Collection<String> fields, Collection<BooleanClause::Occur> flags, AnalyzerPtr analyzer);
102
124 static QueryPtr parse(LuceneVersion::Version matchVersion, Collection<String> queries, Collection<String> fields, Collection<BooleanClause::Occur> flags, AnalyzerPtr analyzer);
125
126 protected:
127 virtual QueryPtr getFieldQuery(const String& field, const String& queryText, int32_t slop);
128 virtual QueryPtr getFieldQuery(const String& field, const String& queryText);
129 void applySlop(QueryPtr query, int32_t slop);
130
131 virtual QueryPtr getFuzzyQuery(const String& field, const String& termStr, double minSimilarity);
132 virtual QueryPtr getPrefixQuery(const String& field, const String& termStr);
133 virtual QueryPtr getWildcardQuery(const String& field, const String& termStr);
134 virtual QueryPtr getRangeQuery(const String& field, const String& part1, const String& part2, bool inclusive);
135 };
136 }
137
138 #endif

clucene.sourceforge.net