- Notifications
You must be signed in to change notification settings - Fork 275
Closed
Labels
Area: SpecificationRelated to the API spec used to generate client codeRelated to the API spec used to generate client codeCategory: BugSomething isn't workingSomething isn't working
Description
Elasticsearch Version
8.14.3
Installed Plugins
No response
Java Version
bundled
OS Version
cloud
Problem Description
The documentation for dense vectors specifies some optional index options. Which means that I can create an index like this:
DELETE test PUT test { "mappings": { "properties": { "vector": { "type": "dense_vector", "index_options": { "type": "hnsw" } } } } }
But in Java, I must specify a value for m
and efConstruction
:
client.indices().create(c -> c.index("test") .mappings(m -> m .properties("vector", p -> p.denseVector(dv -> dv .indexOptions(dvio -> dvio .type("hnsw") ) )) ));
This fails as it's missing values. So I have to fix the code with:
client.indices().create(c -> c.index("test") .mappings(m -> m .properties("vector", p -> p.denseVector(dv -> dv .indexOptions(dvio -> dvio .m(16) .efConstruction(100) .type("hnsw") ) )) ));
Steps to Reproduce
Run this code:
client.indices().create(c -> c.index("test") .mappings(m -> m .properties("vector", p -> p.denseVector(dv -> dv .indexOptions(dvio -> dvio .type("hnsw") ) )) ));
Logs (if relevant)
No response
Metadata
Metadata
Assignees
Labels
Area: SpecificationRelated to the API spec used to generate client codeRelated to the API spec used to generate client codeCategory: BugSomething isn't workingSomething isn't working