Is there a way to get the current refinements that a user checks in the refinement list when getting searchresults?

Currently I want to order my search results in react instantsearch by the facets that a user checks off using the refinementlist widget. When I get these results in “Hits”, is there a way to sort my results based off of facets values and perhaps sort them on the clientside with instantsearch?

For example:

I have a user who wants to search for individuals who have certain skills (Java, python, or more), and each person has a different score for their skill level in that area. If a user has checked off Java and python in the facets, I want to be able to order the results based on the highest aggregated score of the skills that the user wants to search for.

This can be done by transforming the search parameter to add “score” to the facets. For that you need to intercept the search client like this: