Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Solr中的方面组-在一个查询中是否可以这样做_Solr_Facet_Faceted Search - Fatal编程技术网

Solr中的方面组-在一个查询中是否可以这样做

Solr中的方面组-在一个查询中是否可以这样做,solr,facet,faceted-search,Solr,Facet,Faceted Search,我在Solr中处理facet,我有facet组的概念,每个facet组包含许多facet 假设我有一个这样的结构 Product Type - Chairs (50) - Tables (20) - Mirrors (5) Color - Yellow (5) - Black (50) - Red (10) - Orange (10) 我在刻面组中的刻面之间有OR关系,在组之间有and关系 因此,如果我选择椅子作为一个方面,我会得到50种产品。使用Solr中的标准刻面(并假设每个产品可以有一

我在Solr中处理facet,我有facet组的概念,每个facet组包含许多facet

假设我有一个这样的结构

Product Type
- Chairs (50)
- Tables (20)
- Mirrors (5)

Color
- Yellow (5)
- Black (50)
- Red (10)
- Orange (10)
我在刻面组中的刻面之间有OR关系,在组之间有and关系

因此,如果我选择
椅子
作为一个方面,我会得到50种产品。使用Solr中的标准刻面(并假设每个产品可以有一种产品类型和一种颜色),现在将给出:

Product Type
- Chairs (50)
- Tables (0)
- Mirrors (0)

Color
- Yellow (5)
- Black (30)
- Red (5)
- Orange (10)
然而,我真正想要的是,产品类型中的方面计数保持不变,因为这将反映如果选择其中一个,将会发生什么

这可以在一个查询中使用Solr完成吗?

这可以在创建方面时实现

从参考页面:

要实现doctype的多选方面,GUI可能仍希望显示其他doctype值及其关联计数,就好像尚未应用doctype:pdf约束一样。例如:

若要返回当前未选择的doctype值的计数,请标记直接约束doctype的过滤器,并在doctype上刻面时排除这些过滤器

所有类型的面都支持过滤排除。tag和ex local参数都可以通过用逗号分隔来指定多个值


美丽的。非常感谢。
=== Document Type ===
  [ ] Word (42)
  [x] PDF  (96)
  [ ] Excel(11)
  [ ] HTML (63)
q=mainquery&fq=status:public&fq={!tag=dt}doctype:pdf&facet=on&facet.field={!ex=dt}doctype