-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend field stats to include type, searchable, aggregatable #17750
Comments
This will be an issue for some virtual fields like In order not to make it too complicated, I think we can check whether a field is aggregatable by checking whether I don't think we have anything similar for searchable fields, so we would probably have to start by checking |
This made me realize that it is a bug that you can set |
This won't work for us, assuming it means that the entire request to _field_stats will fail. Ideally we would just exclude the field, perhaps with a way of listing the fields that were excluded due to any exception |
I think this is a bit drastic. Ideally Kibana would be able to use this and not have to through some fatal error about the field types not matching. Could the conflicting field have "conflict" set for its type when types conflict? Perhaps we could do the same thing for searchable and aggregatable. |
this is what it does today, but the bullet points beneath that line explain what we need to change it to do:
|
Currently the field stats API will not return any information if the field is not searchable or if there is no document indexed with a value in that field. It makes sense as none of the stats would be available in such cases.
|
Hmm good question... In fact, even if we can aggregate on a field because it has doc values, we can't return the min/max values unless it is also indexed (correct, @jpountz ?). Today, the field stats API will ignore non-indexed fields. |
This is correct: we need doc values to aggregate, but these stats either come from points or from the inverted index. If a field is mapped, I agree there should be an entry regardless of whether it exists in the index or not. |
@clintongormley I started working on the Kibana code to consume this new info and I've realized there was a miss with the PR that closed this issue. Field stats still doesn't include the type of each field, and that info is critical for Kibana. |
After much discussion in #15728 we have agreed to make the following changes to the field stats API:
?fields
will accept wildcards, so that it can match all fieldstype
, and whether it is searchable (index ==true
) and aggregatable (doc_values==true || (index==true && fielddata==true))
When
?level=cluster
(the default), fields with the same name are collapsed into a single entry unless the fields have a differenttype
, in which case the whole request returns an exception. This collapsing process should change as follows:type
, but with anerror
key which describes the error.searchable
andaggregatable
are collapsed totrue
if any of the instances of that field are searchable or aggregatable./cc @rashidkpc @spalger @jpountz @martijnvg
The text was updated successfully, but these errors were encountered: