Hi Ondrej Any decent search solution can handle this - with Sphinx, you need to enable infixes or prefixes. Thinking Sphinx makes this pretty easy - you'll want to add a couple of settings to your config/sphinx.yml file (and create it if you don't yet have one):
http://freelancing-god.github.com/ts/en/common_issues.html#wildcards Rebuild your Sphinx indices by running the ts:rebuild task, and then you can search like so: User.search 'user', :star => true Or manually star it yourself: User.search 'user*' Cheers -- Pat On 19/07/2012, at 5:44 PM, Ondrej Kuzmik wrote: > Hi, I'm new to ruby on rails and i want to develop search engine on my web > site (searching for users). After installing Thinking Sphinx i found that it > can only find user called "user" when typing "user" to search field ("user1" > wont be found). When I was googling I found that there is possibility to > "cut" 1 word into several words, like "user" -> "u s e r", and search for > something like this "u << s << e << r", but this seems like not best idea for > me (maybe I'm wrong, and it's fast and simple to develop?). So my question is > if there is any better solution (with Thinking Sphinx), if not then my > question is, if there is any better rails solution for this type of searching > (regexp), or I just have to make a SQL query. > Thanks for you answer, > Ondrej Kuzmik > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/thinking-sphinx/-/iwhHKHMYmFcJ. > 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.
