Elasticsearch | Kibana | Discover | quick sort on some fields/columns greyed out

You can’t use the quick sort feature on your fields/colums cs it’s disabled/greyed out?

Most likely you did add your documents to your index without doing explicit mapping on index creation. Of course it’s possible to drop your data into the index without defining an explicit mappin, but the quick sort option will be disabled in this case.So the solution is, to create an explicit mapping when creating an index:

    $CURL -s -XPUT ${CREDS}/$1?pretty -H 'Content-Type: application/json' -d '{ "mappings": { "properties": { 
	"bytes": { "type": "integer" }, 
	"dir": { "type": "text", "fielddata": true, "fields": { "keyword": { "type": "keyword", "ignore_above": 1024, "store": true } } }, 
	"name": { "type": "text", "fielddata": true, "fields": { "keyword": { "type": "keyword", "ignore_above": 256, "store": true } } }, 
	"md5": { "type": "text", "fielddata": true, "fields": { "keyword": { "type": "keyword", "ignore_above": 32, "store": true } } }, 
	"type": { "type": "text", "fielddata": true, "fields": { "keyword": { "type": "keyword", "ignore_above": 1024, "store": true } } }, 
	"mime": { "type": "text", "fielddata": true }, 
	"time": { "type": "date", "format": "epoch_second" } 
    } } }'

Date:

The proper function of the quick sort feature on dates rely higly on how the date is formatted. If the engine has problems with your dated format, it will fail, the sorting results will be scrumbled. The easiest way to prevent that, is to insert your dates into the index using the epoch seconds style.

Texts:

To make a text field quick sortable, you will have to add the fielddata parameter.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.