# How to achieve a query like this

**URL:** <https://discuss.elastic.co/t/how-to-achieve-a-query-like-this/29833>\
**Category:** Elasticsearch\
**Created:** [September 23, 2015, 10:41am UTC](https://discuss.elastic.co/t/how-to-achieve-a-query-like-this/29833 "2015-09-23T10:41:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Linus\_Pettersson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/linus_pettersson/32/1107_2.png) [@Linus\_Pettersson](https://discuss.elastic.co/u/Linus_Pettersson)\
**Post date:** [September 23, 2015, 10:41am UTC](https://discuss.elastic.co/t/how-to-achieve-a-query-like-this/29833/1 "2015-09-23T10:41:56Z")

</div>

Hi

I have a list of documents that I always want on top, after them there should be a list of documents matching a list of tags, then it should just fill the rest with documents ordered by date. I have a hard time achieving this.

For the top documents I add a huge boost (based of ids and types).

I'm not sure how to get the rest though. Any ideas?

Top item#1  
Top item#2  
Match on tag1, tag2  
Match on tag2  
No match (ordered by date)  
No match (ordered by date)  
No match (ordered by date)

---

<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 5, 2017, 11:48pm UTC](https://discuss.elastic.co/t/how-to-achieve-a-query-like-this/29833/2 "2017-07-05T23:48:31Z")

</div>

Closed on July 5, 2017, 11:48pm UTC


