我在表单中有两个范围字段。 最小和最大字段。
= form_tag search_items_path, :method => :get do
%label
= t('form.price')
= text_field_tag :min_price, params[:min_price]
= text_field_tag :max_price, params[:max_price]
= submit_tag t('form.search')
= render "search_result"
如何在sphinx中组织范围搜索?
答案 0 :(得分:0)
define_index do
indexes name
has mileage
end
Car.search :with => {:mileage => 100..150000}