Class MultiFieldQueryParser
A QueryParser which constructs queries to search multiple fields.
Inherited Members
Assembly: Lucene.Net.QueryParser.dll
Syntax
[Serializable]
public class MultiFieldQueryParser : QueryParser, ICommonQueryParserConfiguration
Constructors
Name | Description |
---|---|
MultiFieldQueryParser(LuceneVersion, String[], Analyzer) | Creates a MultiFieldQueryParser.
It will, when Parse(String) is called, construct a query like this
(assuming the query consists of two terms and you specify the two fields
When DefaultOperator is set to AND_OPERATOR, the result will be:
In other words, all the query's terms must appear, but it doesn't matter in what fields they appear.
|
MultiFieldQueryParser(LuceneVersion, String[], Analyzer, IDictionary<String, Single>) | Creates a MultiFieldQueryParser. Allows passing of a map with term to Boost, and the boost to apply to each term.
It will, when Parse(String) is called, construct a query like this
(assuming the query consists of two terms and you specify the two fields
When DefaultOperator is set to AND_OPERATOR, the result will be:
When you pass a boost (title=>5 body=>10) you can get
In other words, all the query's terms must appear, but it doesn't matter in what fields they appear.
|
Fields
Name | Description |
---|---|
m_boosts | |
m_fields |
Methods
Name | Description |
---|---|
GetFieldQuery(String, String, Boolean) | |
GetFieldQuery(String, String, Int32) | |
GetFuzzyQuery(String, String, Single) | |
GetPrefixQuery(String, String) | |
GetRangeQuery(String, String, String, Boolean, Boolean) | |
GetRegexpQuery(String, String) | |
GetWildcardQuery(String, String) | |
Parse(LuceneVersion, String, String[], Occur[], Analyzer) | Parses a query, searching on the fields specified. Use this if you need to specify certain fields as required, and others as prohibited. Usage:
The code above would construct a query:
|
Parse(LuceneVersion, String[], String[], Analyzer) | Parses a query which searches on the fields specified. If x fields are specified, this effectively constructs:
|
Parse(LuceneVersion, String[], String[], Occur[], Analyzer) | Parses a query, searching on the fields specified. Use this if you need to specify certain fields as required, and others as prohibited. Usage:
The code above would construct a query:
|