Random Sorting Per Session with Empty Query

Hi! I have a client who wants to have results sorted randomly per new session when an empty search is run. They also want to include sorting by random relevance when there is a query searched. I’ve set up the sorting for random relevance but is there a way to make sure results are sorted randomly per new session on an empty search in the backend? For context, this is for a healthcare client’s Find-A-Doc experience, so there is only one vertical.

Hey Nush!

If you have enabled sorting by random relevance in the Answers Configuration, and the frontend has empty search enabled in the cardName.json file like so:

"SearchBar": {
      "allowEmptySearch": true
    },

Then the search results will be randomized both on empty searches and non-empty searches.

Hope this helps!

Best,

Baigel

Hi @Daniel_Baigel ! Wanted to follow up on this thread with a similar-ish random relevance question - once the random relevance has been added in the Search backend configuration, is the expected behavior that the results will randomize with every search or with every session (i.e. results will randomize on the first load of the session, but the same randomized order will be maintained for the searches within the same session)?

I assumed that the expected behavior would be the former, but I’m seeing that in one session, the results are not constantly randomizing with each search.

Hey @Jamie_Do thanks for the follow-up question!

Our random relevance sorting applies for an entire session, meaning we do not re-randomize between queries within a single session. If you would like to see a new set of randomized results, you would have to close out of your current session and open up a new one.

Best,

Daniel

1 Like