You can also pass :star => true into the search query, and it'll automatically add prefix and suffix stars to each word in the search query.
Cheers -- Pat On 07/07/2011, at 5:30 AM, Sjors wrote: > Hi Pat, > > I wasn't using wildcards, because I want it to return partial matches > without the user typing "*" (especially with autocomplete). So I only > set: > :min_infix_len => 1 > > After adding > :enable_star => 1 > all search results have excerpts, so that's good. > > As a workaround, I can simply add "*" to all search queries in the > controller so the user doesn't have to type "*". > > Thanks, > > Sjors > > On 1 jul, 21:14, Pat Allan <[email protected]> wrote: >> Hi Sjors >> >> This is now possible in Sphinx - and should be fine with Thinking Sphinx >> provided you're using wildcards in your query. For example: >> >> ThinkingSphinx.search('pow*').first.last_name #=> "Power" >> ThinkingSphinx.search('pow*').first.excerpts.last_name #=> "<span >> class=\"match\">Power</span>" >> >> How are you using it where it's not working? >> >> -- >> Pat >> >> On 01/07/2011, at 8:09 AM, Sjors wrote: >> >> >> >> >> >> >> >>> I was wondering if this problem is still around or if I'm doing >>> something wrong. In 2009 Pat wrote [0] that you can't get excerpts on >>> partial matches, that this was due to a "bug" in Sphinx itself and >>> that this might get fixed in the near future. >> >>> I'm using the latest version of Sphinx from SVN and thinking-sphinx >>> 2.0.5. I can get excerpts on full word matches, but not on partial >>> word matches. >> >>> Cheers, >> >>> Sjors >> >>> [0] >>> http://groups.google.com/group/thinking-sphinx/browse_thread/thread/b... >> >>> -- >>> 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 >>> athttp://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. > -- 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.
