# Nested Function\_Score Queries

**URL:** <https://discuss.elastic.co/t/nested-function-score-queries/18240>\
**Category:** Elasticsearch\
**Created:** [June 20, 2014, 10:08pm UTC](https://discuss.elastic.co/t/nested-function-score-queries/18240 "2014-06-20T22:08:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_jagirdar](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@r\_jagirdar](https://discuss.elastic.co/u/r_jagirdar)\
**Post date:** [June 20, 2014, 10:08pm UTC](https://discuss.elastic.co/t/nested-function-score-queries/18240/1 "2014-06-20T22:08:19Z")

</div>

Heyy,

I have system where in the user lists some of his favourite teams and conferences and gives them a preference order lets say Team1 \> Team 2\> Team 3 and Conf1 \> Conf2 \> Conf 3 Let's call it user preferences order

Also I have multiple Indexes containing Teams, Conferences, Events(involving Teams), Shows(Talk shows abt Teams), Stations(podcasts, radio) which have their own preference order.

Based on the user preferences, I need to show the user most relevant data in accordance with the index preferences (Events\>Shows\>Stations\>Teams\>Conferences) (Let's say, System's Index Order)

Can I use Nested Function\_Score queries where in the inner query will query elasticsearch for the teams and conferences listed by the user according to his preference order and the outer function\_score query will have indices and type filters and adding boosts in accordance with proposed system's Index order.

function\_score{  
query : {  
function\_score:{}  
}  
functions : [  
filters, functions  
]  
}

---

<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 6, 2017, 1:20am UTC](https://discuss.elastic.co/t/nested-function-score-queries/18240/2 "2017-07-06T01:20:50Z")

</div>

Closed on July 6, 2017, 1:20am UTC


