public static IAnalysis ProjectAnalysisSettings(AnalysisDescriptor analysis) { analysis .TokenFilters(tokenFilters => tokenFilters .Shingle("shingle", shingle => shingle .MinShingleSize(2) .MaxShingleSize(4) ) ) .Analyzers(analyzers => analyzers .Custom("shingle", shingle => shingle .Filters("standard", "shingle") .Tokenizer("standard") ) ); //normalizers are a new feature since 5.2.0 if (TestClient.VersionUnderTestSatisfiedBy(">=5.2.0")) { analysis.Normalizers(analyzers => analyzers .Custom("my_normalizer", n => n .Filters("lowercase", "asciifolding") ) ); } return(analysis); }
public static IAnalysis ProjectAnalysisSettings(AnalysisDescriptor analysis) { analysis .TokenFilters(tokenFilters => tokenFilters .Shingle("shingle", shingle => shingle .MinShingleSize(2) .MaxShingleSize(4) ) ) .Analyzers(analyzers => analyzers .Custom("shingle", shingle => shingle .Filters("standard", "shingle") .Tokenizer("standard") ) ); if (new SemVer.Range(">=5.2.0").IsSatisfied(TestClient.Configuration.ElasticsearchVersion)) { analysis.Normalizers(analyzers => analyzers .Custom("my_normalizer", n => n .Filters("lowercase", "asciifolding") ) ); } return(analysis); }
protected override IAnalysis FluentAnalysis(AnalysisDescriptor an) => an.Normalizers(d => AssertionSetup.Fluent(AssertionSetup.Name, d));
public static AnalysisDescriptor Initialize(AnalysisDescriptor analysis) => analysis.Normalizers(n => n .Custom(Sort, descriptor => descriptor.Filters("lowercase")));
public static AnalysisDescriptor CreateRemoveNumbersNormalizer(this AnalysisDescriptor analysisDescriptor) { return(analysisDescriptor.Normalizers(norm => norm .Custom(REMOVE_NUMBERS_NORMALIZER_NAME, cstNorm => cstNorm .CharFilters(REMOVE_NUMBERS_CHAR_FILTER_NAME)))); }