I am trying to find a way to prevent multiple posts from appearing in search results that belong to the same author. So far I have tried random scoring, which allows me to maintain pagination. However, I can still have up to 4 of the same authors on this page out of 10 results.
Is there a way to clog a document based on how many times a particular field occurs in the result set? As far as I know, you cannot save a variable or object in script brackets.
I examined several ways to achieve this, but many of them have many disadvantages. For example, removing duplicates and calling again to get a new set of results that are excluded from the list of authors. However, this may also return several of the same authors. Therefore, I leave the query one by one to replace duplicate authors in the result set, and this breaks the deep pagination, because ultimately the other result set that is used to replace the duplicates ends with the pages before the standard search. I also tried aggregation that does not work with pages.
Is there any functionality for distributing or subtracting a documentโs score depending on how many times a document of the same author (or field) appears?
source share