Parses a query, searching on the fields specified. Use this if you need
to specify certain fields as required, and others as prohibited.
Usage: <code> String[] fields = {"filename", "contents", "description"}; BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, BooleanClause.Occur.MUST, BooleanClause.Occur.MUST_NOT}; MultiFieldQueryParser.parse("query", fields, flags, analyzer); </code>The code above would construct a query:
<code> (filename:query) +(contents:query) -(description:query) </code>
if query parsing fails
if the length of the fields array differs from the length of
the flags array
Namespace: Lucene.Net.QueryParsersAssembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1
Syntax
C# |
---|
public static Query Parse( Version matchVersion, string query, string[] fields, BooleanClause..::..Occur[] flags, Analyzer analyzer ) |
Visual Basic |
---|
Public Shared Function Parse ( _ matchVersion As Version, _ query As String, _ fields As String(), _ flags As BooleanClause..::..Occur(), _ analyzer As Analyzer _ ) As Query |
Visual C++ |
---|
public: static Query^ Parse( Version^ matchVersion, String^ query, array<String^>^ fields, array<BooleanClause..::..Occur^>^ flags, Analyzer^ analyzer ) |
Parameters
- matchVersion
- Type: Lucene.Net.Util..::..Version
Lucene version to match; this is passed through to QueryParser.
- query
- Type: System..::..String
Query string to parse
- fields
- Type: array<System..::..String>[]()[][]
Fields to search on
- flags
- Type: array<Lucene.Net.Search..::..BooleanClause..::..Occur>[]()[][]
Flags describing the fields
- analyzer
- Type: Lucene.Net.Analysis..::..Analyzer
Analyzer to use
Return Value
[Missing <returns> documentation for "M:Lucene.Net.QueryParsers.MultiFieldQueryParser.Parse(Lucene.Net.Util.Version,System.String,System.String[],Lucene.Net.Search.BooleanClause.Occur[],Lucene.Net.Analysis.Analyzer)"]