For example, in google.com, there are 2 type of search results, 1. Ads that relevant to keyword and 2. normal search result.
How can I do that with Elastic search with following conditions
- Show Ads for 3 slots with random by userid in a top 3 in search result
- Show normal search result that also random by userid
How to make a single query to integrate those two conditions together in search result.
Given sample data, query with 'a' then it should return random(paid 1-3) then follow by random(normal 4-6)
{"type" : "paid", "document" : "paid random 1"}
{"type" : "paid", "document" : "paid random 2"}
{"type" : "paid", "document" : "paid random 3"}
{"type" : "normal", "document" : "normal random 4"}
{"type" : "normal", "document" : "normal random 5"}
{"type" : "normal", "document" : "normal random 6"}