# How to put selected rows items on top of results

**URL:** <https://discuss.elastic.co/t/how-to-put-selected-rows-items-on-top-of-results/232118>\
**Category:** Elasticsearch\
**Created:** [May 11, 2020, 11:33pm UTC](https://discuss.elastic.co/t/how-to-put-selected-rows-items-on-top-of-results/232118 "2020-05-11T23:33:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![duenguyen](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@duenguyen](https://discuss.elastic.co/u/duenguyen)\
**Post date:** [May 11, 2020, 11:33pm UTC](https://discuss.elastic.co/t/how-to-put-selected-rows-items-on-top-of-results/232118/1 "2020-05-11T23:33:21Z")

</div>

How can I put selected items on top of results? For example I want id 3 and 4 on top after sort by name. Similar to SQL Order in query.

Let's say I have an index call person.  
GET person/\_search

```
{
hits: [
  "_source" : {
     "id" : 1,
      "name" : "Paul"
  },
  "_source" : {
     "id" : 2,
      "name" : “Mike”
  },
  "_source" : {
     "id" : 3,
      "name" : “Alex”
  },
  "_source" : {
     "id" : 4,
      "name" : “Susan”
  }

```

]  
}

My current search query:

```
{ "track_total_hits": true,
"from" : 0,
"size" : 30,
"query":{
  "query_string":
  {
    "query": " some query matchin"
  }
}, "sort" :
[
  {"nae" : {"order" : "desc"}}
] }}
```

---

<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 8, 2020, 11:33pm UTC](https://discuss.elastic.co/t/how-to-put-selected-rows-items-on-top-of-results/232118/2 "2020-06-08T23:33:25Z")

</div>

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