예제 #1
0
        private TokenFiltersDescriptor CreateTokenFilterDescriptor()
        {
            var tokenFilters = new TokenFiltersDescriptor();

            tokenFilters.WordDelimiter("word_filter", w => w
                                       .GenerateWordParts(true)
                                       .GenerateNumberParts(true)
                                       .CatenateWords(false)
                                       .CatenateNumbers(false)
                                       .CatenateAll(false)
                                       .SplitOnCaseChange(false)
                                       .PreserveOriginal(false)
                                       .SplitOnNumerics(false)
                                       .StemEnglishPossessive(false)
                                       );

            tokenFilters.PatternReplace("filler_filter", p => p
                                        .Pattern(".*" + Common.Constants.TextFieldSeparator + ".*")
                                        .Replacement(string.Empty)
                                        );

            return(tokenFilters);
        }
 public static TokenFiltersDescriptor AddWordDelimeter(this TokenFiltersDescriptor fd)
 {
     return(fd.PatternReplace(ElasticFilters.FilterWordDelimiter, wd => wd.Pattern("_").Replacement(" ")));
 }