Problem with Ultrasphinx & Aspell & Boolean Search (spell check missbehaves...)

278 Views Asked by At

I'm using Ultrasphinx with Aspell spelling support to search a Rails app. I want my users to be able to search using boolean operators ("king OR queen"). I'm using the german aspell directory, since the app is for Germany.

The Problem: Ultrasphinx always proposes corrections for the boolean OR ("did you mean 'king OHR queen'") which is kind of funny (Ohr means Ear) but also a little sad, because I don't know what to do against that.

Should I modify the stopwords list? (tried, but didn't work)

Should I add 'OR' to the Aspell directory? (How?)

Thanks for your help! Olaf

1

There are 1 best solutions below

0
On

I don't know how Ultrasphinx works exactly but I guess you could replace OR with "|" which is the "or" operand for sphinxs' extended query syntax. Sames goes for "and" => "&". Not would require some additional code because you have to glue it with the adjacent word.