Skip to content

Custom SynonymTokenFilter not working #97

@AthenaChang

Description

@AthenaChang

I tired to create a SynonymTokenFilter for our project by using IndexSettingBuilder(), but always got a
"Filter name not found" error. We are still using ElasticSearch 0.9.10 version. Here are the codes:

Func<SynonymTokenFilter, SynonymTokenFilter> sFilter = (s) => s.Name("synonymTokenFilter").Synonyms(new List { "boldglo => bold glow" });

        return new IndexSettingsBuilder()
        .Analysis(als => als
          .Filter(tokenFilter => tokenFilter.Synonym(sFilter))
          .Analyzer(a => a
            .Custom("synonymAnalyzer", custom => custom
            .Tokenizer(DefaultTokenizers.whitespace)
            .Filter(new List<string> { "sFilter" }))))
            .BuildBeautified();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions