Get field stats for indices only, which contain field. #3424
Motivation and Context
Before this change, field stats for fields failed on shards of indices,
After this change, the field stats request checks which indices contain
There are also other places in the code which would probably require this check (histogram/terms stats), this needs verification and probably the creation of additional PRs.
Types of changes
Before this change, field stats for fields failed on shards of indices, which do not contain the field. The error was buried in the result set (instead of an explicit "all shards failed" error) when indices were included in the query, which contain messages with the specified field, but the aggregations (total, cardinality) failed and returned 0. After this change, the field stats request checks which indices contain the specified field and use those indices only. Fixes #3402.