I know it’s possible to do stuff like that:
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
So I tried to add facets on the location like this:
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
But I get the following error: undefined method near for #<Sunspot::DSL::Restriction:[...]>. Why is it not a Sunspot::DSL::RestrictionWithNear?
If you got facets with locations working, please, help me 😉
Thanks
The answer is simple: switch to ElasticSearch <3 http://www.elasticsearch.org/