【问题标题】:Sunspot: facets on location太阳黑子:位置方面
【发布时间】:2011-11-07 04:11:10
【问题描述】:

我知道可以做这样的事情:

bod = Time.zone.now.beginning_of_day
facet :start_time do
    row :past do
        with(:from).less_than bod - 1.day
    end
    row :today do
        with :from, bod
    end
end

所以我尝试像这样在位置上添加构面:

with(:coordinates).near(coord[0], coord[1], :precision => 3)
facet :distance do
    row 2 do
        with(:coordinates).near(coord[0], coord[1], :precision => 2)
    end
    row 3 do
        with(:coordinates).near(coord[0], coord[1], :precision => 3)
    end
end

但我收到以下错误:undefined method near for #<Sunspot::DSL::Restriction:[...]>。为什么不是 Sunspot::DSL::RestrictionWithNear?

如果你有工作地点的方面,请帮助我;)

谢谢

【问题讨论】:

    标签: ruby-on-rails-3 solr sunspot facets


    【解决方案1】:

    答案很简单:切换到 ElasticSearch http://www.elasticsearch.org/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-20
      • 1970-01-01
      • 1970-01-01
      • 2012-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多