It is hard explain without example.
I need Full-Text Search
SELECT * FROM products WHERE MATCH(name) AGAINST('lamp') ORDER BY name
Returns:
"alarm lamp"
"lamp"
"trouble lamp"
"wall lamp"
But: SELECT * FROM products WHERE MATCH(name) AGAINST('lamp') ORDER BY
name!='lamp', name
Returns:
"lamp"
"alarm lamp"
"trouble lamp"
"wall lamp"
Note difference, first result is "lamp" exactly same as search word was,
and after that comes "alarm lamp" and so on..
So now we only add: catalogues.name, catalogue_items.position,
products.name, products.price to results...
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---