I'm sure that I'm overlooking something since this is my first time using Searchlogic.
Whenever I use a statement like Listing.city_like_or_state_like(params[:search])
in my controller, Rails returns an "Undefined Method" error. I'm trying to search 2 fields within the same model.
However, if I use Listing.city_like(params[:search])
everything is totally fine.
Am I missing something here? I thought OR conditions could be chained together with Searchlogic. How can I implement an OR statement?
I think you can use named_scopes and pass the params straight to SearchLogic
models/listing.rb
controllers/listing_controller.rb
I'm up-voting aNoble's answer though :D
Searchlogic only supports one "operator" per call. So what you want to do is