0

我在一个表单中有两个范围字段。最小和最大字段。

= 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 中组织范围搜索?

4

1 回答 1

0
define_index do
  indexes name

  has mileage
end
Car.search :with => {:mileage => 100..150000}
于 2013-08-26T11:00:11.047 回答