# How to get a Term list for a field?

**URL:** <https://discuss.elastic.co/t/how-to-get-a-term-list-for-a-field/303968>\
**Category:** Elasticsearch\
**Created:** [May 4, 2022, 3:50pm UTC](https://discuss.elastic.co/t/how-to-get-a-term-list-for-a-field/303968 "2022-05-04T15:50:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iam](https://avatars.discourse-cdn.com/v4/letter/i/58956e/32.png) [@iam](https://discuss.elastic.co/u/iam)\
**Post date:** [May 4, 2022, 3:50pm UTC](https://discuss.elastic.co/t/how-to-get-a-term-list-for-a-field/303968/1 "2022-05-04T15:50:33Z")

</div>

Hi All,

Is there a way to get a sorted list of terms from a field in Elasticsearch?

We are going to migrate from Solr to ES and we need something similar to /terms handler, for example:  
`http://localhost:8983/solr/mydatabase/terms?terms.fl=title&terms.sort=index&terms.lower=cat&terms.limit=50`

In this example Solr returns 50 terms started from "cat" and sorted alphabetically.  
"mydatabase" can have 10-20 million terms in a field and it's frequently updated.

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:** [June 1, 2022, 3:50pm UTC](https://discuss.elastic.co/t/how-to-get-a-term-list-for-a-field/303968/2 "2022-06-01T15:50:37Z")

</div>

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