Add a "matching score" and sort by relevance for query sort/filter results

I am using a custom post type ‘solution’ with a custom taxonomy ‘solution_features’.

I use a bricks query loop to output the solutions and brick filters (checkboxes) to filter the data by the terms.

This works fine.

I want to output a simple matching score (percentage) for each post in the loop. If the post matches all selected terms, then it is 100%. If only one out of 10, then it is 10%, and so on. Sorting by score would also be great.

I hope this is understandable and someone can point me in the right direction :wink: