-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Auto detect field type when sorting on unmapped_type fields #4593
Comments
Hopefully this solves your issue. :) Please let us know if it doesn't. |
Works for me |
For me also! |
@lukasolson should we add the sort options for the unmapped type to date by default? |
Worked for me too |
@rashidkpc Is there a reason we chose |
I tried to pick the simplest data type possible. The parameter is really only used when a field is missing in some index, so blanket setting it to date would only work for instances in which a date field was the one missing. See unmapped_type docs here: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_ignoring_unmapped_fields |
what about dinamically setting the unmapped field in the call for the field that we are trying to aggregate @lukasolson @rashidkpc |
This doesn't apply to aggregations, its only for document sorting. We could probably add an option on the field in the index pattern for the type to use if the field is missing, but really that would be a UI hack to a data problem The right answer here is to fix your data so you're not trying to sort on things that don't exist and update the mapping for your indices that are missing |
This could be a good approach. At this point, i've pointed this issue to many people, so looks like it's still confusing and it happens that people from the community use multiple indices to search and sort with fields that don't work. Some times, there is no fix for the data. It makes sense when it comes to sort by |
Hi, Here is excerpt of kibana output and actual log output Kibana Dashboard
This is Actual output means, this is what is in application log file Application Log
|
Removing discuss label - we will triage this in the context of Discovery team. |
I agree we should be able to set this dynamically, assuming the selected field doesn't have conflicting types across indices. The only complication is that we don't maintain the exact field type in our index pattern cache, it's normalized into things like "number" and "string" instead of "long" or "keyword". We'd either need to do an additional query to figure out the exact type to use or figure out if there's a safe default to use for each normalized type. |
Is this really something we need to implement in Kibana, or is the right solution just to not use an unmapped_type in the index? Wondering if we should close this as "will not implement". If we do want to keep it around, perhaps re-label as enhancement request and update the title to be a bit more descriptive (e.g. "Allow sorting on unmapped field types by dynamically guessing their type"). But weighing in without much context, it seems like adding this support in Kibana is more trouble than it's worth. |
I think unmapped fields are quite common for index patterns with schemas that change often. We really don't want a sort to fail just because a user added a field at some point. However I could see an argument being made for implementing this in ES instead of Kibana. Would be cool if the unmapped_type param had an "auto" option. It would probably use the exact same algorithm we would use, but would have better access to the necessary info to make a good choice. |
Works for me too |
I don't believe we have any near-term plans to work on this. This does seem like something that would be better implemented in Elasticsearch. |
When discovering results we are setting the unmapped_type for the timestamp (probably for the default field?) field as boolean instead of date.
Inspecting the Kibana 4 call, we can find a query like:
In Kibana, you will see a message like
Discover: An error occurred with your request. Reset your inputs and try again.
.In Elasticsearch, you will find an exception like
Instead of being setting the unmapped_type to a boolean, it should be set to a date field.
The text was updated successfully, but these errors were encountered: