This article presents a solution based on relative scoring to detect Elasticsearch or Lucene search requests returning poorly matching results. It also explains why this problem is difficult to solve.

Context

Assume that you are selling books and a user search “A Song of Ice and Fire”. Sadly, you don’t sell this particular book (poor you), but you are selling books containing either “song”, “ice” or “fire” in their title.

These books will be shown to the user as a result to his search, but he is likely to be disappointed.

Being able to detect search requests returning poorly matching documents…

Pierre-Nicolas Mougel

Freelance developper

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store