user1861148
user1861148

Reputation: 41

Solr fuzzy search on 'hotdog' and 'hot dog'

New to Solr search, I can't make it to happen so that when I search Hot dog, it can find hotdog, and when I search hotdog, it can find hot dog. Did try to put it into synonyms.txt, but does not work. Did try text_general, text_en, and text_en_splitting.

Did try hotdog~, "hot dog"~14, "hot~ dog~"~14

Upvotes: 4

Views: 148

Answers (2)

Ravi
Ravi

Reputation: 873

Did you try hot~ AND dog~ assuming that the default field is set to the field you are searching.

If you want to do a explicit search using field name the query will be like below.

fieldName:hot~ AND fieldName:dog~

Upvotes: 1

Parvin Gasimzade
Parvin Gasimzade

Reputation: 26012

You can solve it by adding the following line into the synonyms.txt file.

hot dog, hotdog

Make sure that you set expand=true in the SynonymFilterFactory definition.

It will be better to use SynonymFilterFactory during index time.Then re-index your data and it should work.

Btw, I am using the Solr 3.6.1 version and used text_general for indexing.

Upvotes: 1

Related Questions