Nested Function_Score Queries


(r.jagirdar) #1

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
]
}


(system) #2