# How to sort multiple field values in order?

**URL:** <https://discuss.elastic.co/t/how-to-sort-multiple-field-values-in-order/91217>\
**Category:** Elasticsearch\
**Created:** [June 29, 2017, 4:51am UTC](https://discuss.elastic.co/t/how-to-sort-multiple-field-values-in-order/91217 "2017-06-29T04:51:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamA](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@SamA](https://discuss.elastic.co/u/SamA)\
**Post date:** [June 29, 2017, 4:51am UTC](https://discuss.elastic.co/t/how-to-sort-multiple-field-values-in-order/91217/1 "2017-06-29T04:51:39Z")

</div>

I have a field called chocolate\_type. There are 4 different chocolate types ("Dark", "White", "Milk", "Sweet"). I want my documents to be sorted in a specific order based on the chocolate type. I do not want to sort the chocolate types in ascending or descending order. Instead, I want them to be sorted where white is first, dark second, milk third, and sweet fourth. Here's an example of how the documents should be sorted:

```
id: 5,
chocolate_type: "White"

id: 8,
chocolate_type: "White"

id: 15,
chocolate_type: "Dark"

id: 18,
chocolate_type: "Dark"

id: 24,
chocolate_type: "Dark"
.
.
.

```

How can I make a query that does this?

---

<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:** [July 27, 2017, 4:51am UTC](https://discuss.elastic.co/t/how-to-sort-multiple-field-values-in-order/91217/2 "2017-07-27T04:51:47Z")

</div>

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