Is there a way to avoid very similar documents one after another in results?

Imagine a transactional system where sometimes the user can apply the same operation to a group of items. This operation generates a text based on a model provided by the user and only changes one or two specific terms:

"Lorem ipsum [SPECIFIC TERM #1] dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est [SPECIFIC TERM #2] laborum."

Suppose the user runs the operation for 10 items on a given day. But assume also that a lot of the terms in the model appear in other models written by other users...

Well, when searched for a set of terms present both in the user's 1 model and user's 2 model I'd like the results to offer some variety, and not list all the 10 documents created by the user 1 in a row.

The one thing is, I'm not sure we index an attribute on which we could collapse.

Is there a way use some "not % like this" for each of the documents of the result list? I mean, I'd want the second result to be somehow different from the first one, and not almost like the same.

Thank you!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.