How can i filter with a stopword list in django haystack (whoosh)
-
24-06-2021 - |
سؤال
I am making an api call where the user passes a string and the database is queried with that string. The correct results are returned but i want to add stopwords for different languages to use for extra filtering.
When i use words like 'and' etc. in the search it ignores it like it should, but this is only for English.
المحلول
I created a custom search backend which extends whoosh_backend.SearchBackend and in the build_schema function passed the stopword list to the StemmingAnalyzer.
لا تنتمي إلى StackOverflow