Brief recap of where we arrived in the preceding article: we had the following synonyms and stopwords settings:
- synonyms = {“out of warranty”,”oow”}
- stopwords = {“of”}
Both of those filters were configured exclusively at query-time; the synonym filter first and then the stopwords filter.
Using the built-in StopFilter we had a synonym detection issue because the removal of the “of” term in the query string (e.g. “my device ran out of warranty“). For that reason, we introduced a custom StopFilter subclass which was aware about stopwords in synonyms.
The other scenario we are going to describe is a little bit different: let’s suppose we have the following data:
- synonyms = {test code, tdd, testing}
- stopwords = {my, your, how ,to, in}
Still here, we want to manage synonyms and stopwords only at query time.
We have this document indexed: