When you use 8.x Java Client to create an index within CreateIndexRequest.Builder and specify similarity in settings builder, there is no field type, which Elasticsearch server waits for and it returns an error, pointing that a type must be specified.
This behaviour begins from 8.0.1 version of client.
What is the best way using Java API to override this behaviour?
Had upated today. Both client and server are of 8.3.3 ver. The code
new CreateIndexRequest.Builder().
.settings(s -> s
.similarity(
new SettingsSimilarity.Builder().lmj(
new SettingsSimilarityLmj.Builder()
.lambda(2)
.build()
).build()
)
)
runs into error:
[es/indices.create] failed: [illegal_argument_exception] Similarity [lmj] must have an associated type
Will try now to use the sencod approach you suggested.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.