0

目前我正在尝试

json.facet={
  "category" : { "type": "terms", "field": "category" },
  "initial_category" : { "type": "terms", "field": "category", domain: { excludeTags: "*"} }
}

但没有成功。

我需要initial_category检索没有所有过滤器的存储桶。

完整的查询是

curl http://localhost:8983/solr/items/query -d '
q=name:phone&
fq={!tag=size}size:2XL&
rows=0&
json.facet={
  "category" : { "type": "terms", "field": "category"},
  "initial_category" : { "type": "terms", "field": "category", domain: { excludeTags: ""} }
}'

如何从构面中排除所有标签?

4

1 回答 1

1

试试看:

json.facet={
  "category": {
    "type": "terms",
    "field": "category"
  },
  "initial_category": {
    "type": "terms",
    "field": "category",
    domain: {
      query: "*:*"
    }
  }
}

facet.domain.query 允许在任意查询上运行构面,而不管主域如何。

https://lucene.apache.org/solr/guide/8_0/json-faceting-domain-changes.html#arbitrary-domain-query

于 2020-08-31T18:58:17.543 回答