【发布时间】:2013-10-15 17:40:57
【问题描述】:
如何使用通配符在 Sunspot solr 中进行搜索? 使用 * 不起作用,我要返回所有结果用于教育。
Education 是一个可以存在“All”、“High”、“Low”的集合,所以现在我的想法是如果它是“All”,则将其从搜索块中删除
with(:orientation, params[:orientation])
if params[:orientation].present? unless params[:orientation] == "all"
一定是更好的方法吗?
搜索块:
search = Sunspot.search Session do
if params[:education].present?
if params[:education] == "all"
# Use a wildcard here
#with(:education, *)
end
end
end
【问题讨论】:
标签: ruby-on-rails search solr sunspot