我有刻面问题。 想象一下这种情况。 产品可以在多个类别中。 这是分面的常见行为:
类别
Android(25) iPhone(55) 其他(25)现在,当我选择“Android”时,我使用“fq”=>“category:Android”进行新查询,我会得到:
类别
Android的 iPhone(15) 其他(2)但这意味着有15种产品,分别是“Android”和“iPhone”。 我想要这样的东西:(“Android”或“iPhone”)
类别
Android的 iPhone(+5) 其他(+1)意思是通过选择“Android(25)”获得25个结果,选择“iPhone(+5)”获得另外5个,最后我将得到30个搜索结果。
有没有人知道SOLR的分面是否可行? 或者可能有多个查询并手动计算?
谢谢你的建议!
I have problems with faceting. Imagine this situation. Product can be in more than one category. This is common behavior for faceting:
Category
Android (25) iPhone (55) other (25)Now when I select "Android", I make new query with "fq" => "category:Android", I will get:
Category
Android iPhone (15) other (2)But this means that there is 15 products, that are in categories "Android" AND "iPhone". I would like something like this: ("Android" OR "iPhone")
Category
Android iPhone (+5) other (+1)Meaning I will get 25 results by selecting "Android (25)" and another 5 by selecting "iPhone (+5)", so finally I will get 30 search results..
Does anyone know if this is possible with SOLR's faceting? Or perhaps with more than one query and calculate it manually?
Thanks for advice!
最满意答案
尝试使用选项否定的新查询,例如"fq" => "-category:Android" - 然后您应该获得您正在寻找的方面计数。
Try a new query with the negative of the selections, like "fq" => "-category:Android" - you should then get the facet counts you are looking for.
更多推荐
发布评论