Closed
Description
Java API client version
8.3.3
Java version
17
Elasticsearch Version
8.3.3
Problem description
new CreateIndexRequest.Builder().
.settings(s -> s
.similarity(
new SettingsSimilarity.Builder().lmj(
new SettingsSimilarityLmj.Builder()
.lambda(2)
.build()
).build()
)
Response from Elasticsearch is:
[es/indices.create] failed: [illegal_argument_exception] Similarity [lmj] must have an associated type
This is the same error received from Elasticsearch when you run REST api with JSON:
PUT /index
{
"settings": {
"similarity": {
"lmj": {
"lambda": 2
}
}
}
}
And there is no possibility to write custom similarities or specify wanted field type
in existing ones. As well as you cannot specify similarity-name with this Java API.
This issue starts from 8.0.1 till 8.3.3 (current). In earlier versions there are no SimilarityXXX
classes at all.