Class CommonGramsQueryFilter
Wrap a CommonGramsFilter optimizing phrase queries by only returning single words when they are not a member of a bigram.
Example:
- query input to CommonGramsFilter: "the rain in spain falls mainly"
- output of CommomGramsFilter/input to CommonGramsQueryFilter: |"the, "the-rain"|"rain" "rain-in"|"in, "in-spain"|"spain"|"falls"|"mainly"
- output of CommonGramsQueryFilter:"the-rain", "rain-in" ,"in-spain", "falls", "mainly"
Inherited Members
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
[Serializable]
public sealed class CommonGramsQueryFilter : TokenFilter, IDisposable
Remarks
See:http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc//all/org/apache/lucene/analysis/TokenStream.html and http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/analysis/package.html?revision=718798
Constructors
Name | Description |
---|---|
CommonGramsQueryFilter(CommonGramsFilter) | Constructs a new CommonGramsQueryFilter based on the provided CommomGramsFilter |
Properties
Name | Description |
---|---|
IsGramType | Convenience method to check if the current type is a gram type |
Methods
Name | Description |
---|---|
IncrementToken() | Output bigrams whenever possible to optimize queries. Only output unigrams when they are not a member of a bigram. Example:
|
Reset() | This method is called by a consumer before it begins consumption using IncrementToken(). Resets this stream to a clean state. Stateful implementations must implement this method so that they can be reused, just as if they had been created fresh.
If you override this method, always call |