Closed
Description
Java API client version
8.13.2
Java version
17
Elasticsearch Version
8.12.2
Problem description
Hello, I read in the documentation: "Use synonyms_set configuration option to provide a synonym set created via Synonyms Management APIs:", but the SynonymGraphTokenFilter class does not have a corresponding field, there are only synonyms (String) and synonymsPath. How can I provide a set of synonyms?
private final ElasticsearchClient client;
client.indices().create(
new CreateIndexRequest.Builder()
.index(INDEX_PREFIX + "_" + name)
.settings(new IndexSettings.Builder()
.numberOfShards(SHARDS)
.numberOfReplicas(REPLICAS)
.analysis(new IndexSettingsAnalysis.Builder()
.analyzer("search_analyzer", new Analyzer.Builder()
.custom(new CustomAnalyzer.Builder()
.tokenizer("standard")
.filter("synonym_graph")
.build())
.build())
.filter("synonym_graph", new TokenFilter.Builder()
.definition(new TokenFilterDefinition.Builder()
.synonymGraph(new SynonymGraphTokenFilter.Builder()
.updateable(true)
.build())
.build())
.build())
.build())
.build())
.build()
);