【发布时间】:2011-07-10 09:12:06
【问题描述】:
在 sunspot solr 中,我们可以通过 facets 对具有相似属性的记录进行分组。但是是否可以从两个属性中进行构面过滤?
我尝试在搜索中这样做:
facet_search = User.search do
facet :attribute1, :attribute2
end
facet_search.facet(:attribute1, :attribute2)
有了这个,我不断得到 nil 值,并且我确信在属性 1 和属性 2 有具有相似值的记录。
假设有两条记录的属性 1 的值为“橙色”。这两条记录在属性 2 处的值为“eagles”。
我可以使用 sunspot 中的一项功能来根据两列对记录进行分组吗?我该怎么做?
提前感谢您的帮助。
【问题讨论】:
标签: ruby-on-rails full-text-search solr sunspot-rails