Date range facets with Sunspot in Ruby on Rails

前端 未结 2 813
南笙
南笙 2021-02-10 23:03

I am using Sunspot to search for events (parties, concerts, ...) in a Ruby on Rails 3 application.

I have managed to set up free text s

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-10 23:39

    You can do in this way:

    with(:registration_date).between(params[:start_date].to_date..params[:end_date].to_date)
    

    Look here: http://sunspot.github.io/docs/Sunspot.html#search-class_method

提交回复
热议问题