Exemple #1
0
 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);
 }
Exemple #2
0
 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")));
Exemple #5
0
 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))));
 }