C# 클래스 Lucene.Net.QueryParsers.Classic.MultiFieldQueryParser

A QueryParser which constructs queries to search multiple fields.
상속: QueryParser
파일 보기 프로젝트 열기: apache/lucenenet 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
boosts float>.IDictionary
fields string[]

공개 메소드들

메소드 설명
MultiFieldQueryParser ( LuceneVersion matchVersion, string fields, Analyzer analyzer ) : Lucene.Net.Analysis

Creates a MultiFieldQueryParser. It will, when QueryParserBase.Parse(string) is called, construct a query like this (assuming the query consists of two terms and you specify the two fields title and body): (title:term1 body:term1) (title:term2 body:term2) When QueryParserBase.DefaultOperator is set to QueryParserBase.AND_OPERATOR, the result will be: +(title:term1 body:term1) +(title:term2 body:term2) In other words, all the query's terms must appear, but it doesn't matter in what fields they appear.

MultiFieldQueryParser ( LuceneVersion matchVersion, string fields, Analyzer analyzer, float>.IDictionary boosts ) : Lucene.Net.Analysis

Creates a MultiFieldQueryParser. Allows passing of a map with term to Boost, and the boost to apply to each term. It will, when QueryParserBase.Parse(string) is called, construct a query like this (assuming the query consists of two terms and you specify the two fields title and body): (title:term1 body:term1) (title:term2 body:term2) When QueryParserBase.DefaultOperator is set to QueryParserBase.AND_OPERATOR, the result will be: +(title:term1 body:term1) +(title:term2 body:term2) When you pass a boost (title=>5 body=>10) you can get +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0) In other words, all the query's terms must appear, but it doesn't matter in what fields they appear.

Parse ( LuceneVersion matchVersion, string queries, string fields, Analyzer analyzer ) : Query

Parses a query which searches on the fields specified. If x fields are specified, this effectively constructs: (field1:query1) (field2:query2) (field3:query3)...(fieldx:queryx)

Parse ( LuceneVersion matchVersion, string query, string fields, BooleanClause flags, Analyzer analyzer ) : Query

Parses a query, searching on the fields specified. Use this if you need to specify certain fields as required, and others as prohibited. Usage: 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: (filename:query) +(contents:query) -(description:query)

보호된 메소드들

메소드 설명
GetFieldQuery ( string field, string queryText, bool quoted ) : Query
GetFieldQuery ( string field, string queryText, int slop ) : Query
GetFuzzyQuery ( string field, string termStr, float minSimilarity ) : Query
GetPrefixQuery ( string field, string termStr ) : Query
GetRangeQuery ( string field, string part1, string part2, bool startInclusive, bool endInclusive ) : Query
GetRegexpQuery ( string field, string termStr ) : Query
GetWildcardQuery ( string field, string termStr ) : Query

비공개 메소드들

메소드 설명
ApplySlop ( Query q, int slop ) : void

메소드 상세

GetFieldQuery() 보호된 메소드

protected GetFieldQuery ( string field, string queryText, bool quoted ) : Query
field string
queryText string
quoted bool
리턴 Lucene.Net.Search.Query

GetFieldQuery() 보호된 메소드

protected GetFieldQuery ( string field, string queryText, int slop ) : Query
field string
queryText string
slop int
리턴 Lucene.Net.Search.Query

GetFuzzyQuery() 보호된 메소드

protected GetFuzzyQuery ( string field, string termStr, float minSimilarity ) : Query
field string
termStr string
minSimilarity float
리턴 Lucene.Net.Search.Query

GetPrefixQuery() 보호된 메소드

protected GetPrefixQuery ( string field, string termStr ) : Query
field string
termStr string
리턴 Lucene.Net.Search.Query

GetRangeQuery() 보호된 메소드

protected GetRangeQuery ( string field, string part1, string part2, bool startInclusive, bool endInclusive ) : Query
field string
part1 string
part2 string
startInclusive bool
endInclusive bool
리턴 Lucene.Net.Search.Query

GetRegexpQuery() 보호된 메소드

protected GetRegexpQuery ( string field, string termStr ) : Query
field string
termStr string
리턴 Lucene.Net.Search.Query

GetWildcardQuery() 보호된 메소드

protected GetWildcardQuery ( string field, string termStr ) : Query
field string
termStr string
리턴 Lucene.Net.Search.Query

MultiFieldQueryParser() 공개 메소드

Creates a MultiFieldQueryParser. It will, when QueryParserBase.Parse(string) is called, construct a query like this (assuming the query consists of two terms and you specify the two fields title and body): (title:term1 body:term1) (title:term2 body:term2) When QueryParserBase.DefaultOperator is set to QueryParserBase.AND_OPERATOR, the result will be: +(title:term1 body:term1) +(title:term2 body:term2) In other words, all the query's terms must appear, but it doesn't matter in what fields they appear.
public MultiFieldQueryParser ( LuceneVersion matchVersion, string fields, Analyzer analyzer ) : Lucene.Net.Analysis
matchVersion LuceneVersion
fields string
analyzer Lucene.Net.Analysis.Analyzer
리턴 Lucene.Net.Analysis

MultiFieldQueryParser() 공개 메소드

Creates a MultiFieldQueryParser. Allows passing of a map with term to Boost, and the boost to apply to each term. It will, when QueryParserBase.Parse(string) is called, construct a query like this (assuming the query consists of two terms and you specify the two fields title and body): (title:term1 body:term1) (title:term2 body:term2) When QueryParserBase.DefaultOperator is set to QueryParserBase.AND_OPERATOR, the result will be: +(title:term1 body:term1) +(title:term2 body:term2) When you pass a boost (title=>5 body=>10) you can get +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0) In other words, all the query's terms must appear, but it doesn't matter in what fields they appear.
public MultiFieldQueryParser ( LuceneVersion matchVersion, string fields, Analyzer analyzer, float>.IDictionary boosts ) : Lucene.Net.Analysis
matchVersion LuceneVersion
fields string
analyzer Lucene.Net.Analysis.Analyzer
boosts float>.IDictionary
리턴 Lucene.Net.Analysis

Parse() 공개 정적인 메소드

Parses a query which searches on the fields specified. If x fields are specified, this effectively constructs: (field1:query1) (field2:query2) (field3:query3)...(fieldx:queryx)
if query parsing fails /// if the length of the queries array differs from the length of /// the fields array ///
public static Parse ( LuceneVersion matchVersion, string queries, string fields, Analyzer analyzer ) : Query
matchVersion LuceneVersion Lucene version to match; this is passed through to /// .
queries string Queries strings to parse
fields string Fields to search on
analyzer Lucene.Net.Analysis.Analyzer Analyzer to use
리턴 Lucene.Net.Search.Query

Parse() 공개 정적인 메소드

Parses a query, searching on the fields specified. Use this if you need to specify certain fields as required, and others as prohibited. Usage: 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: (filename:query) +(contents:query) -(description:query)
if query parsing fails /// if the length of the fields array differs from the length of /// the flags array ///
public static Parse ( LuceneVersion matchVersion, string query, string fields, BooleanClause flags, Analyzer analyzer ) : Query
matchVersion LuceneVersion Lucene version to match; this is passed through to /// .
query string Query string to parse
fields string Fields to search on
flags Lucene.Net.Search.BooleanClause Flags describing the fields
analyzer Lucene.Net.Analysis.Analyzer Analyzer to use
리턴 Lucene.Net.Search.Query

프로퍼티 상세

boosts 보호되어 있는 프로퍼티

protected IDictionary boosts
리턴 float>.IDictionary

fields 보호되어 있는 프로퍼티

protected string[] fields
리턴 string[]