I'm trying to get this Aggregations thing working with my search results page.
I'm struggling with this at the moment. So far i do not know what to put into my view.
I have this in my controller,
@events = Event.search params[:search], suggest: true, partial: true, misspellings: {distance: 2}, aggs: [:eventname, :type]
I don't know what to put in the view, I cant seem to find any help for this.
Also I would like to put a date filter on, So any events that are within a certain date range it would only show these.
Any help would be much appreciated
Sam
To get searched events
@events.to_a
To get events count
@events.count
To get aggregation result
@events.aggs
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.