Sphinx returns poor search results

I am using Sphinx with the Thinking Sphinx plugin. I indexed a model called Venue with the following code (and the rake thinking_sphinx: index command)

define_index do
    indexes :name
    indexes city
    indexes zip
end

I get the results in my controller using this code:

@venues = Venue.search params[:search]

and I make them like json. The problem with me is that when I hit this url:

http://localhost:3000/venue/list?search=Baltimo

I get nothing. But when I hit this url:

http://localhost:3000/venue/list?search=Baltimor

I collect all Places located in the city of Baltimore. For some reason, one character matters. Theoretically, I should get all the places in Baltimore if I'm just looking for one character - "b"

Does anyone know what is going on here?

thanks

+5
source share
1

enable_star 1 min_prefix_len min_infix_len 1 , B ( , , B * ).

, , Thinking Sphinx Sphinx , ( , ) , Baltimor .

- , - config/sphinx.yml:

development:
  enable_star: 1
  min_infix_len: 1
test:
  enable_star: 1
  min_infix_len: 1
production
  enable_star: 1
  min_infix_len: 1

Sphinx, Sphinx. , , B * .

, .

+6

All Articles