Synonyms search in elastticsearch.net nest 7.5

I am working on the synonyms search in nest 7.5. Do you have example for it? Most examples online are for old version nest.

What is the replacement for .createIndex in nest 7.5?

Here is my current code, but it does not work

public void setIndex(ElasticClient client, List Users)
{

    client.Indices.Delete("user");
    var user = Users[0];

    client.Bulk(b => b
     .Index("user")
     .IndexMany(Users)
     );

    var analyzeResponse = client.Indices.Analyze(a => a
        .Analyzer("standard")
        .Text("F# is THE SUPERIOR language :)")
    );

    client.Indices.UpdateSettings("analysis-index", i => i
    .IndexSettings(s => s
        .Analysis(a => a
              .TokenFilters(t => t.NGram("nGram", n => n.MinGram(2)
                                      .MaxGram(20)))
              .CharFilters(cf => cf
                .Mapping("my_char_filter", m => m
                    .Mappings("F# => FSharp")
                )
            )
            .TokenFilters(tf => tf
                .Synonym("my_synonym", sf => sf
                    .Synonyms("superior, great")

                )
            )
            .Analyzers(an => an
                .Custom("my_analyzer", ca => ca
                    .Tokenizer("standard")
                    .CharFilters("my_char_filter")
                    .Filters("lowercase", "stop", "my_synonym")
                )
            )

        )
    )
);
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.