elastic/elasticsearch-java

indices.get() throws transport exception when fetching indices that have a dense_vector mapping with no dims

ddocul opened this issue · 1 comments

Java API client version

8.12.2

Java version

21

Elasticsearch Version

8.12.2

Problem description

create a new mapping with a dense vector type, but omit the 'dims' parameter (optional as of 8.11)

PUT my-index
{
  "mappings": {
    "properties": {
      "my_vector": {
        "type": "dense_vector"
      },
      "my_text" : {
        "type" : "keyword"
      }
    }
  }
}

Then attempt to call indices.get() from the java api. Note response is 200, but it fails to decode the response.

co.elastic.clients.transport.TransportException: node: http://localhost:9200/, status: 200, [es/indices.get] Failed to decode response
	at co.elastic.clients.transport.ElasticsearchTransportBase.decodeTransportResponse(ElasticsearchTransportBase.java:404) ~[elasticsearch-java-8.12.2.jar:na]
	at co.elastic.clients.transport.ElasticsearchTransportBase.getApiResponse(ElasticsearchTransportBase.java:363) ~[elasticsearch-java-8.12.2.jar:na]
	at co.elastic.clients.transport.ElasticsearchTransportBase.performRequest(ElasticsearchTransportBase.java:147) ~[elasticsearch-java-8.12.2.jar:na]
	at co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient.get(ElasticsearchIndicesClient.java:965) ~[elasticsearch-java-8.12.2.jar:na]
	at co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient.get(ElasticsearchIndicesClient.java:981) ~[elasticsearch-java-8.12.2.jar:na]

Hello, thank you for reporting this, it's definitely an API specification used to produce the Java code. Once it's fixed the Java client code will be updated to solve this.