Hi, I have a marketplace app and all the items that are published have a “priority” level as a data field. This is in attempt to create a “boosting” service where users who pay can have their items boosted and appear first in search results and the marketplace page. However, I want the products to be organized by the priority level and then randomized within the other items of same priority levels.
I tried using several sort options in the search for items but unfortunately I can’t use random sorting as an option when there is another sort option (“priority” in this case).
Try using grouped by operator. If that doesn’t work just feed first priority level first with merged by operator and next level list then merge again and repeat for each level.
Thank you for your response. I’m not really sure how to use the grouped by operator but when using the priority field to group, the result was just three items that were all blank, which after inspecting it, each of the three is the combination of all items that have the same priority level, instead of having all the items be organized by the priority and then randomized as intended (seen in the ss).
As for the merged with solution that worked. The items are now ordered by priority. My only concern is how efficient this actually is in terms of workunits. Wont this way of merging searches essentially 2x or 3x the amount of item searches done? Wouldn’t that be much worse? Or what could I do to limit the amount of work units consumed?
I think what @boston85719 mean is to use two nested RG. One that will be “priority” type (if exist… if not, could be text or grouping). If you have a type or an OS for the priority value, you should use that. if not, you can use groub by. And inside this RG, add another one that will search for items where the priority = current cell priority. You will be able to use random operator for this nested RG.
There is no way around it if you also want to randomly sort them within their priority level. Remove the need to sort randomly within priority level and you can get them in order of priority without consuming extra WUs.