SQL for search
Hi Chris,
I had a question, solved it, now I'm looking for your feedback. For readability I use `a` in the example below:
a = params[:query] Item.where("name ILIKE ? OR tagline ILIKE ? OR details ILIKE ?", "%#{a}%", "%#{a}%", "%#{a}%")
Do you have a similar query on gorails search for episode titles and forum thread titles?
Hey Robert!
I actually use Ransack to take care of this for me, but it's doing basically exactly that. I make two queries when you search, one for episodes, one for forum threads and then just display them in the autocomplete.
Eventually I might switch to ElasticSearch, but it requires a lot of RAM and probably wouldn't be a huge improvement to the search results anyways.
I actually use Ransack to take care of this for me, but it's doing basically exactly that. I make two queries when you search, one for episodes, one for forum threads and then just display them in the autocomplete.
Eventually I might switch to ElasticSearch, but it requires a lot of RAM and probably wouldn't be a huge improvement to the search results anyways.