I have a simple form, where I set up a query that I want to browse, for example panasonic viera.
This is on how I search the term in database:
Product.where("name ilike ?", "%#{params[:q]}%").order('price')
The query looks like %panasonic viera%, but I would need to search the query this way: %panasonic%viera% – I need to find all products, where is in the title the word panasonic or viera… but how to make this query?
One solution would be to break up your query into individual terms and build a set of database queries connected by
OR.