简体   繁体   English

排除solr中的构面字段

[英]excluding facet field in solr

Its a badly inserted data in solr which is the issue but is there way to fix the below scenerio. 它在solr中插入的数据很差,这是一个问题,但是有办法修复以下场景。

"Attributes": [
      "Width=680 mm",
      "Height=990 mm",
      "Type=Recycling",
      "Color=White"
      "Size= L"

    ]

At front-end, all of the above fields are grouped according to key of the attribute , user can select any one of them. 在前端,以上所有字段均根据属性的键进行分组,用户可以选择其中任意一个。

There would be no issue at all if the above data would have been inserted as separate fields against a document(i can not change that). 如果将以上数据作为文档的单独字段插入,将完全没有问题(我无法更改)。 I could have easily exclude the facet field to show the count of the other related attribute. 我可以轻松排除facet字段以显示其他相关属性的数量。 For example when user select Size L, i could show the result for XL and S. 例如,当用户选择大小L时,我可以显示XL和S的结果。

But with this above data, its not possible to exclude correctly in case user select 'Color' and 'Size' at the same time. 但是使用上述数据,如果用户同时选择“颜色”和“尺寸”,则无法正确排除。

Any suggestions? 有什么建议么?

This can be achieved through tagging and excluding. 这可以通过标记和排除来实现。 You tag a filter and exclude them while building the facet counts. 您标记过滤器并在构建构面计数时排除它们。 In your case 就你而言

select?q=*:*&fq={!tag=pr}size:L&facet=on&facet.field={!ex=pr}size

You can do it for multiple facets too. 您也可以在多个方面进行操作。 Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM