# How to find whether the field in elasticSearch is sortable and analysed

**URL:** <https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106>\
**Category:** Elasticsearch\
**Created:** [February 22, 2021, 6:03pm UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106 "2021-02-22T18:03:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepti](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Deepti](https://discuss.elastic.co/u/Deepti)\
**Post date:** [February 22, 2021, 6:03pm UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/1 "2021-02-22T18:03:10Z")

</div>

How to find whether the field in elasticSearch is sortable and analysed

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 22, 2021, 11:00pm UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/2 "2021-02-22T23:00:23Z")

</div>

Welcome to our community! 😃

By default all fields are analysed. You will need to check the mappings for the index to see if it's explicitly set (or not) though.

You will also need to check the index settings to see if there are any sorts defined.

---

<div class="post-metadata">

**Author:** ![Deepti](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Deepti](https://discuss.elastic.co/u/Deepti)\
**Post date:** [February 23, 2021, 2:38am UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/3 "2021-02-23T02:38:53Z")

</div>

Thank you @warkolm

Keyword data type is not analysed by default if iam not wrong ,and not all the datatypes are sortable

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 23, 2021, 2:55am UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/4 "2021-02-23T02:55:40Z")

</div>

It depends what you mean by sortable, it [this](https://www.elastic.co/guide/en/elasticsearch/reference/7.11/index-modules-index-sorting.html)?

> [@Deepti](#):
>
> Keyword data type is not analysed by default if iam not wrong

You are right. But that's only if you have them defined as a keyword.

---

<div class="post-metadata">

**Author:** ![Deepti](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Deepti](https://discuss.elastic.co/u/Deepti)\
**Post date:** [February 23, 2021, 3:59am UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/5 "2021-02-23T03:59:31Z")

</div>

If we use the field capability API on a field which is of type keyword the response is something like this

"Email" : {  
"keyword" : {  
"type" : "keyword",  
"searchable" : true,  
"aggregatable" : true  
}  
}  
This response indicates that it's searchable ,does this mean it's analysed?(keyword datatype is not analysed,but here it is true for searchable)  
2nd question would be does aggregatable:true mean it's sortable?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 23, 2021, 4:16am UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/6 "2021-02-23T04:16:38Z")

</div>

You need to check the mappings.

---

<div class="post-metadata">

**Author:** ![Deepti](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Deepti](https://discuss.elastic.co/u/Deepti)\
**Post date:** [February 23, 2021, 4:36am UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/7 "2021-02-23T04:36:43Z")

</div>

@warkolm

This is the mapping :  
PUT my-index-000003  
{  
"mappings": {  
"properties": {  
"tags": {  
"type": "keyword"  
}  
}  
}  
}

Response of field capability API:

GET /my-index-000003/\_field\_caps?fields=tags  
{  
"indices" : [  
"my-index-000003"  
],  
"fields" : {  
"tags" : {  
"keyword" : {  
"type" : "keyword",  
"searchable" : true,  
"aggregatable" : true  
}  
}  
}  
}

Now does this indicate that "tags" field which is of type keyword is analysed and sortable?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 23, 2021, 6:56am UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/8 "2021-02-23T06:56:23Z")

</div>

Again, it depends what you mean by sortable. See my prior response and link.

The field is _not_ analysed, no.

---

<div class="post-metadata">

**Author:** ![Deepti](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Deepti](https://discuss.elastic.co/u/Deepti)\
**Post date:** [March 5, 2021, 4:00am UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/9 "2021-03-05T04:00:16Z")

</div>

@warkolm thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 2, 2021, 4:01am UTC](https://discuss.elastic.co/t/how-to-find-whether-the-field-in-elasticsearch-is-sortable-and-analysed/265106/10 "2021-04-02T04:01:06Z")

</div>

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