You'll need to add in the wildcard stars yourself: @username "*oco*"~3
I'm presuming you've got the enable_star and min_infix_len settings set? See halfway down this page: http://pat.github.com/ts/en/advanced_config.html -- Pat On 02/10/2012, at 5:09 PM, Lephyrius wrote: > I want to search for users by only their username and not the > presentation. > So I added a index: > define_index do > indexes username > indexes presentation > set_property field_weights: { username: 7, presentation: 1 } > if Rails.env.production? > set_property delta: FlyingSphinx::DelayedDelta > end > end > > And then searched using this method call: > > User.search("@username \"#{params[:term]}\"~3", match_mode: :extended) > > I have these users in the DB: Roco, Loco and Coco. > When I search for: > Sphinx Query (2.6ms) @username "oco"~3 > Sphinx Found 0 results > > I was expecting: Roco, Loco and Coco but I got 0 results instead. > What am I doing wrong? > Do I need to filter the search term before I insert it to sphinx > query? Any function for it? > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en. > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
