I recently added searchkickto my web application, but the study only works with name fields. There is my code:
MODEL:
class Campaign
[...]
searchkick language: "French"
[...]
def self.search_fields(params)
@query = "*#{params[:search]}*"
@search = Campaign.search @query, fields: [:name, :categories, :professional, :brief] , misspellings: {distance: 2}
@search.results
end
But, with
@search = Campaign.search @query, fields: [:name, :categories, :professional, :brief] , misspellings: {distance: 2}
The study only works with the name of each model. But I want to search in other fields, for example: categories ,: professional ,: brief, date, etc.
How can i do this?
source
share