Closed
Description
Elasticsearch Version
main
Installed Plugins
No response
Java Version
bundled
OS Version
Not relevant
Problem Description
Mappings that contain a lot of nested fields at multiple levels suffer from a very slow fields
option in the _search
request.
The FieldFetcher
initialisation seems to create a lot of redundant FieldFetcher
for every nested field paths.
The following gist reproduces the issue.
Retrieving a single empty doc without providing any field in the field
option takes several seconds due to the initialisation of the nested field fetcher.
I believe that the performance bug was introduced in #67432.
I marked the issue as a performance bug since having lots of nested fields shouldn't make every query using the fields
option slow.
Steps to Reproduce
See https://gist.github.com/jimczi/87fd6bb6a4428cccbabb986de917f234
Logs (if relevant)
No response