# Sort on array?

**URL:** <https://discuss.elastic.co/t/sort-on-array/83413>\
**Category:** Elasticsearch\
**Created:** [April 24, 2017, 12:46pm UTC](https://discuss.elastic.co/t/sort-on-array/83413 "2017-04-24T12:46:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickheneise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrickheneise/32/17615_2.png) [@patrickheneise](https://discuss.elastic.co/u/patrickheneise)\
**Post date:** [April 24, 2017, 12:46pm UTC](https://discuss.elastic.co/t/sort-on-array/83413/1 "2017-04-24T12:46:54Z")

</div>

Hi there,

I'm working on a fairly old codebase which is heavily using Elasticsearch query strings. Now I'm struggling with a new feature request. This would be a document example:

```
{
  "title": "My Literature",
  "category": "Books",
  "tags": [
    "Featured"
  ],
  "createdAt": "2016-08-02T17:53:46.428Z",
  "updatedAt": "2016-08-12T21:44:02.858Z"
}

```

I know my life could be a lot easier if "featured" would be an attribute or if I'd be using regular query DSL.

Instead, I have a querystring:

`_type:literature AND category:Books`

and want "featured" items to show up first in the list. All with the same query. I wonder if I can either boost the tag "featured" or do something like `"sort": ["tags:Featured", "_score"]`. I did try that already without success.

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:** [May 22, 2017, 12:54pm UTC](https://discuss.elastic.co/t/sort-on-array/83413/2 "2017-05-22T12:54:46Z")

</div>

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