Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django-haystack search for #hashtag [duplicate]

I really have 0 experience in Haystack, but we use django-haystack for our search. For now the search works fine, but I just added #hashtags to the site and I would like the search to work somehow different for hashtagged words.

What I have right now:

  • The results of searching for "pizza" and "#pizza" are the same, I think this is happening because "#" is being omitted in the search as a character.

What I want to accomplish:

  • The results of searching for "#pizza" should only containt the text "#pizza".

Hope anyone can help me

like image 724
PepperoniPizza Avatar asked Nov 13 '22 10:11

PepperoniPizza


1 Answers

Other people have modified WordDelimiterFilterFactory and WordDelimiterFilter to handle @ and #-characters as digits. Maybe that can work for you too?

like image 51
Emil Stenström Avatar answered Nov 15 '22 08:11

Emil Stenström