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.
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…