C# 클래스 Lucene.Net.QueryParsers.Analyzing.AnalyzingQueryParser

Overrides Lucene's default QueryParser so that Fuzzy-, Prefix-, Range-, and WildcardQuerys are also passed through the given analyzer, but wildcard characters * and ? don't get removed from the search terms. Warning: This class should only be used with analyzers that do not use stopwords or that add tokens. Also, several stemming analyzers are inappropriate: for example, Analysis.De.GermanAnalyzer will turn Häuser into hau, but H?user will become h?user when using this parser and thus no match would be found (i.e. using this parser will be no improvement over QueryParser in such cases).
상속: Classic.QueryParser
파일 보기 프로젝트 열기: apache/lucenenet 1 사용 예제들

공개 메소드들

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

보호된 메소드들

메소드 설명
AnalyzeSingleChunk ( string field, string termStr, string chunk ) : string

Returns the analyzed form for the given chunk. If the analyzer produces more than one output token from the given chunk, a ParseException is thrown.

GetFuzzyQuery ( string field, string termStr, float minSimilarity ) : Query

Called when parser parses an input term that has the fuzzy suffix (~) appended. Depending on analyzer and settings, a fuzzy term may (most probably will) be lower-cased automatically. It will go through the default Analyzer. Overrides super class, by passing terms through analyzer.

GetPrefixQuery ( string field, string termStr ) : Query

Called when parser parses an input term that uses prefix notation; that is, contains a single '*' wildcard character as its last character. Since this is a special case of generic wildcard term, and such a query can be optimized easily, this usually results in a different query object. Depending on analyzer and settings, a prefix term may (most probably will) be lower-cased automatically. It will go through the default Analyzer. Overrides super class, by passing terms through analyzer.

GetWildcardQuery ( string field, string termStr ) : Query

Called when parser parses an input term that uses prefix notation; that is, contains a single '*' wildcard character as its last character. Since this is a special case of generic wildcard term, and such a query can be optimized easily, this usually results in a different query object. Depending on analyzer and settings, a prefix term may (most probably will) be lower-cased automatically. It will go through the default Analyzer. Overrides super class, by passing terms through analyzer.

메소드 상세

AnalyzeSingleChunk() 보호된 메소드

Returns the analyzed form for the given chunk. If the analyzer produces more than one output token from the given chunk, a ParseException is thrown.
ParseException when analysis returns other than one output token
protected AnalyzeSingleChunk ( string field, string termStr, string chunk ) : string
field string The target field
termStr string The full term from which the given chunk is excerpted
chunk string The portion of the given termStr to be analyzed
리턴 string

AnalyzingQueryParser() 공개 메소드

public AnalyzingQueryParser ( LuceneVersion matchVersion, string field, Analyzer analyzer ) : Lucene.Net.Analysis
matchVersion LuceneVersion
field string
analyzer Lucene.Net.Analysis.Analyzer
리턴 Lucene.Net.Analysis

GetFuzzyQuery() 보호된 메소드

Called when parser parses an input term that has the fuzzy suffix (~) appended. Depending on analyzer and settings, a fuzzy term may (most probably will) be lower-cased automatically. It will go through the default Analyzer. Overrides super class, by passing terms through analyzer.
protected GetFuzzyQuery ( string field, string termStr, float minSimilarity ) : Query
field string Name of the field query will use.
termStr string Term to use for building term for the query
minSimilarity float
리턴 Lucene.Net.Search.Query

GetPrefixQuery() 보호된 메소드

Called when parser parses an input term that uses prefix notation; that is, contains a single '*' wildcard character as its last character. Since this is a special case of generic wildcard term, and such a query can be optimized easily, this usually results in a different query object. Depending on analyzer and settings, a prefix term may (most probably will) be lower-cased automatically. It will go through the default Analyzer. Overrides super class, by passing terms through analyzer.
protected GetPrefixQuery ( string field, string termStr ) : Query
field string Name of the field query will use.
termStr string Term to use for building term for the query (without trailing '*' character!)
리턴 Lucene.Net.Search.Query

GetWildcardQuery() 보호된 메소드

Called when parser parses an input term that uses prefix notation; that is, contains a single '*' wildcard character as its last character. Since this is a special case of generic wildcard term, and such a query can be optimized easily, this usually results in a different query object. Depending on analyzer and settings, a prefix term may (most probably will) be lower-cased automatically. It will go through the default Analyzer. Overrides super class, by passing terms through analyzer.
protected GetWildcardQuery ( string field, string termStr ) : Query
field string Name of the field query will use.
termStr string Term to use for building term for the query /// (without trailing '*' character!)
리턴 Lucene.Net.Search.Query