I'm trying to use the Sitecore GraphQL search function that takes in the "facetOn" parameter. Unfortunately I'm not having much luck with the results, and I suspect it's because I'm doing something wrong and don't know where to look for the documentation. So I have a Field called "Category" and I want to facet on that when I search because I imagine it will essentially give me a count of different "Category" value occurrences. But the below is not working.
query {
search(rootItem: "92B4F8E7-6324-4C01-B873-7FDC992EDDEE" facetOn:["_category"] ) {
results {
totalCount
items {
item {
name
_category: field(name: "Category") {
value
}
}
}
}
facets {
name
values {
item {
id
}
value
}
}
}
}