Parses a query, searching on the fields specified. Use this if you need to specify certain fields as required, and others as prohibited.

            Usage:
            
CopyC#
String[] fields = {"filename", "contents", "description"};
BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD,
BooleanClause.Occur.MUST,
BooleanClause.Occur.MUST_NOT};
MultiFieldQueryParser.parse("query", fields, flags, analyzer);

The code above would construct a query:

CopyC#
(filename:query) +(contents:query) -(description:query)
from the length of the flags array

Namespace: Lucene.Net.QueryParsers
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
[ObsoleteAttribute("Use Parse(Version, String, String[], BooleanClause.Occur[], Analyzer) instead")]
public static Query Parse(
	string query,
	string[] fields,
	BooleanClause..::..Occur[] flags,
	Analyzer analyzer
)
Visual Basic
<ObsoleteAttribute("Use Parse(Version, String, String[], BooleanClause.Occur[], Analyzer) instead")> _
Public Shared Function Parse ( _
	query As String, _
	fields As String(), _
	flags As BooleanClause..::..Occur(), _
	analyzer As Analyzer _
) As Query
Visual C++
[ObsoleteAttribute(L"Use Parse(Version, String, String[], BooleanClause.Occur[], Analyzer) instead")]
public:
static Query^ Parse(
	String^ query, 
	array<String^>^ fields, 
	array<BooleanClause..::..Occur^>^ flags, 
	Analyzer^ analyzer
)

Parameters

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(System.String,System.String[],Lucene.Net.Search.BooleanClause.Occur[],Lucene.Net.Analysis.Analyzer)"]

See Also