String field in Discover is not sortable, and .keyword field and alias field are both empty

We noticed that only keyword and date field are sort-able in "Discover" , not string and numeric field. I found a post that mentioned we need to use .keyword field in order to make it sortable, to enable it, we need to disable the "Hide missing fields" in the "Available fields" setting. But something which is strange, the .keyword field has missing values. We have an alias field pointing to the .keyword field too, that field also has missing value. When I added the .keyword field and the alias field to clumn, I see an warning message "Unable to write index pattern. Refresh the page to getthe most up to date changes for the index pattern"

Would be great if I can get some recommendation from someone.

image

Hey @qub123,

Based on having to disable "hide missing fields", I'd say that it's expected that these fields wouldn't contain any data. To me the question is: why are these fields empty? If you query this index directly in the Kibana Console, do you see data in those keyword fields?

What does your index mapping look like for the underlying indices? Can you provide a copy of that?

When I added the .keyword field and the alias field to clumn, I see an warning message "Unable to write index pattern. Refresh the page to getthe most up to date changes for the index pattern"

We've seen this in the past when concurrent updates to the index pattern take too long to save. To triage that further, it would be great to capture a HAR showing this. If you're comfortable doing so, instructions for generating a HAR can be found here: Kibana HAR Instructions · GitHub

Hi @Larry_Gregory,

Please see the post post, according to @Bargs (Elastic Team memeber), it is common behavior that unchecking "Hide missing field" is a common behavior to see the "keyword" field in Discover. And also it seems like there is bug in alias too, the issue has been raised since august 2018, but until now the error still hasn't been fixed.

Discover doesn't show field aliases · Issue #21705 · elastic/kibana · GitHub ](Discover doesn't show field aliases · Issue #21705 · elastic/kibana · GitHub

Here you can see the field mapping for the activity_type, activity_type.keyword, and the alias Activity_Type. I tried to filter in the activity_type.keyword, and also filter with alias Activity_Type. Both return correct result, but same problem also, the .keyword and alias column have empty value again.

image

Pic: filter with activity_type.keyword field, return correct result on the activity_type text field

Pic: Filter with alias "Activity_type", return correct result on the activity_type text field.

@qub123 thank you for taking the time to explain the problem to me in more detail - that was very helpful, and I understand it better now.

The multi-field problem seems to be captured in an even older issue here: https://github.com/elastic/kibana/issues/7419.

More importantly, it looks like we've made some progress on this front recently. I still don't know when this will be fully resolved, but I linked back to this post as another data point for the team to consider, and asked for an update on the issue.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.