# Is this type of sorting possible?

**URL:** <https://discuss.elastic.co/t/is-this-type-of-sorting-possible/81193>\
**Category:** Elasticsearch\
**Created:** [April 4, 2017, 6:04pm UTC](https://discuss.elastic.co/t/is-this-type-of-sorting-possible/81193 "2017-04-04T18:04:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![twisted1919](https://avatars.discourse-cdn.com/v4/letter/t/e495f1/32.png) [@twisted1919](https://discuss.elastic.co/u/twisted1919)\
**Post date:** [April 4, 2017, 6:04pm UTC](https://discuss.elastic.co/t/is-this-type-of-sorting-possible/81193/1 "2017-04-04T18:04:34Z")

</div>

Hi guys,

I have a small instance of ES that has indexed a bit over 1k documents with fields like: `title`, `description`, `date_added`, `last_updated`.

The `title` and `description` are using this analyzer:

```
'stringLowercase' => array(
    'type' => 'custom',
    'tokenizer' => 'keyword',
    'filter' => array('standard', 'lowercase', 'stop', 'minimalEnglishStem')
),

```

(minimalEnglishStem is just the `minimal_english` stemmer)

At this moment, we're doing wildcard searches on the title and description and we give the title a higher boost than we give to description, which overall works fine, so let's say i am searching for the word `seo` i get all the posts which contain the word in either title or description ordered by the date they have been added.

What we would like to do, is to order the results so that we put the ones having the word `seo` in the title first and then at the end, the ones that contain the word `seo` in description.

Is this doable somehow?  
Thank you.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 5, 2017, 2:16pm UTC](https://discuss.elastic.co/t/is-this-type-of-sorting-possible/81193/2 "2017-04-05T14:16:04Z")

</div>

Have a look at field boosting in the [`multi_match`](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html) query.

---

<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:** [May 3, 2017, 2:16pm UTC](https://discuss.elastic.co/t/is-this-type-of-sorting-possible/81193/3 "2017-05-03T14:16:28Z")

</div>

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