Hi :) I need to make something like a search engine, this means I post a query like "cat" and I'd like rails to find all rows with specified field containing this word, like "black bat", "catwalk" and so Is there any other option than :condition => ["content LIKE %?%", search_mask] ??? Thank you in advance :)
on 09.05.2008 09:27
on 09.05.2008 15:23
On Fri, 2008-05-09 at 00:27 -0700, Paweł K wrote: > Hi :) > > I need to make something like a search engine, this means I post a > query like "cat" and I'd like rails to find all rows with specified > field containing this word, like "black bat", "catwalk" and so > > Is there any other option than :condition => ["content LIKE %?%", > search_mask] ??? > > Thank you in advance :) ---- sure - you can find_by_sql and thus any SQL select statement you can come up with can be used. Craig
on 09.05.2008 15:28
On May 9, 2:22 pm, Craig White <craigwh...@azapple.com> wrote: > On Fri, 2008-05-09 at 00:27 -0700, Pawe³ K wrote: > ---- > sure - you can find_by_sql and thus any SQL select statement you can > come up with can be used. More generally a full text search engine (mysql's builtin one, sphinx, ferret etc...) will be more powerful than mashing things around with Like and %. (some will do stemming and things like that as well) Fred