pat / thinking-sphinx

Sphinx/Manticore plugin for ActiveRecord/Rails
http://freelancing-gods.com/thinking-sphinx
MIT License
1.63k stars 470 forks source link

thinking_sphinx not giving the near by match results #1075

Closed santoshbt closed 6 years ago

santoshbt commented 6 years ago

Hello,

I am trying to implement the functionality similar to MySQL Like, but after trying lot of options, still unable to get the desired results. I am using thinking-sphinx-3.4.2.

Please help.

pat commented 6 years ago

Hi Santosh

Can you provide an example of what you're trying to do, and the behaviour you'd like to see?

santoshbt commented 6 years ago

Hi Pat

For Example, I am indexing on article title, which has Ruby, Java, Book123 etc. I want the search output for "rub" string to be Ruby and "boo" has to give Book123 result. But it is returning 0 results. If I search for full word, I get the proper results. I have tried, star option, match_mode, min_infix option etc.. But no luck..

pat commented 6 years ago

I would expect the following to work:

In your config/thinking_sphinx.yml

development:
  min_infix_len: 1

# repeat for each environment

Don't forget to run rake ts:rebuild once you've made that change. And then when searching:

Article.search "rub", :star => true
santoshbt commented 6 years ago

Hi Pat,

Thanks this worked.. 👍

pat commented 6 years ago

Great :)