Closed
Description
Elasticsearch Version
9.0.3
Installed Plugins
No response
Java Version
bundled
OS Version
Linux fedora 6.15.3-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 19 15:00:25 UTC 2025 x86_64 GNU/Linux
Problem Description
When upgrading from Elasticsearch 9.0.2 to 9.0.3 search queries for long
/scaled_float
field types started returning illegal_state_exception
:
{
"error": {
"root_cause": [
{
"type": "illegal_state_exception",
"reason": "unexpected docvalues type NONE for field 'my-field' (expected one of [SORTED_NUMERIC, NUMERIC]). Re-index with correct docvalues type."
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "test-long-field-000001",
"node": "AletyvwqRRiBHgHykXF71g",
"reason": {
"type": "illegal_state_exception",
"reason": "unexpected docvalues type NONE for field 'my-field' (expected one of [SORTED_NUMERIC, NUMERIC]). Re-index with correct docvalues type."
}
}
],
"caused_by": {
"type": "illegal_state_exception",
"reason": "unexpected docvalues type NONE for field 'my-field' (expected one of [SORTED_NUMERIC, NUMERIC]). Re-index with correct docvalues type.",
"caused_by": {
"type": "illegal_state_exception",
"reason": "unexpected docvalues type NONE for field 'my-field' (expected one of [SORTED_NUMERIC, NUMERIC]). Re-index with correct docvalues type."
}
}
},
"status": 500
}
Steps to Reproduce
For this test, Elasticsearch is started from the official Docker image.
- Create a simple index with a long field, and set doc values to
false
PUT http://localhost:9200/test-long-field-000001
Content-Type: application/json
{
"mappings": {
"dynamic": "strict",
"properties": {
"my-field": {
"type": "long",
"doc_values": false
}
}
}
}
- Add a document:
POST http://localhost:9200/test-long-field-000001/_doc/1
Content-Type: application/json
{
"my-field" : -251484254
}
- Try searching against this index, e.g.:
POST http://localhost:9200/test-long-field-000001/_search
Content-Type: application/json
{
"query": {
"match": {
"my-field": {
"query": -251484254
}
}
}
}
This results in the error mentioned in the description above.
Similar errors are observed if the field is a scaled_float
e.g. has the following configuration:
"my-field": {
"type": "scaled_float",
"doc_values": false,
"scaling_factor": 100
}
Testing the same on Elasticsearch 9.0.2 and prior versions -- works ok. And produces the expected results, e.g.:
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 1.0,
"hits": [
{
"_index": "test-long-field-000001",
"_id": "1",
"_score": 1.0,
"_source": {
"my-field": -251484254
}
}
]
}
}
Logs (if relevant)
No response