Open
Description
Elasticsearch Version
8.16.1
Installed Plugins
analysis-icu, mapper-size
Java Version
OpenJDK Runtime Environment (build 17.0.13+12-LTS)
OS Version
Linux elasticsearch-master-0 5.10.207 #1 SMP PREEMPT Tue Sep 3 18:23:52 UTC 2024 aarch64 GNU/Linux
Problem Description
Get field mapping query with a wildcard field matching any field of type search_as_you_type
causes server to respond with empty response {}
.
Steps to Reproduce
-
Create index
curl -X PUT localhost:9200/my-index -H 'Content-Type: application/json' -d ' { "mappings": { "properties": { "field1a": { "type": "search_as_you_type" }, "field1b": { "type": "text" }, "field2a": { "type": "text" }, "field2b": { "type": "text" } } } }'
-
Query field mapping
curl -X GET 'localhost:9200/my-index/_mapping/field/field1*'
Expected behaviour
Step 2 returns:
{ "my-index": { "mappings": { "field1a": { "full_name": "field1a", "mapping": { "field1a": { "type": "search_as_you_type", "doc_values" : false, "max_shingle_size" : 3 } } }, "field1b": { "full_name": "field1b", "mapping": { "field1b": { "type": "text" } } } } } }
Actual behaviour
Step 2 returns:{}
Not only is
field1a
not returned, but neither is any other field matched (E.g.field1b
, or all other fields if using/_mapping/field/*
). -
Querying non-existing fields return differently
curl -X GET 'localhost:9200/my-index/_mapping/field/field3*' {"my-index":{"mappings":{}}}
-
Querying the
search_as_you_type
exactly without wildcard does workcurl -X GET 'localhost:9200/my-index/_mapping/field/field1a' { "my-index": { "mappings": { "field1a": { "full_name": "field1a", "mapping": { "field1a": { "type": "search_as_you_type", "doc_values": false, "max_shingle_size": 3 } } } } } }
Logs (if relevant)
No logs lines are written