Hello guys,
My site use elasticsearch query for fetch adversiting data of customers. My query on elastic sort data considering SCORE calculed from score function. (I use score because many properties make a difference in the order that the data should be returned from elastic, such as whether the ad is premium or not etc.)
I need to keep sorting by score, but i want to Shuffle data for elasticsearch brings adversiting from different customers, which are differentiated by the customerID field. As the records are sorted by score, elastic returns a certain flood, containing multiple pages with adversting from just one customer.
Basically i wanna keep soring by function score, avoid the flood and bring as much as more possible different customers adversiting, that is diferencied by field customerID
PRATICAL EXAMPLE:
I have customer A that have 80 adversiting.
I have customer B that have 12 adversiting.
The adverstings of A and B are ordered by score and both ADS that elastic returns have a high score value. But when elasticsearch run the query is returned FIRST 80 adversiting of A and after 12 adversiting of B. Since my website is paging results, the adversiting of customer B will be shown only in last pages leaving customer B at a disadvantage.