Hello, David!
Thanks for trying out App Search. And welcome to the community!
We have two main pieces of documentation to help with the construction of faceted queries.
There is the API reference (https://swiftype.com/documentation/app-search/api/search/facets)...
It shows an example request, with a facet object alongside a query:
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/search' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \
-d '{
"query": "park",
"facets": {
"states": [
{
"type": "value",
"sort": { "count": "desc" },
"size": 5
}
]
}
}' | jq
You can run this query within your own terminal, too -- the key and Engine are public.
The response shows how we would expect the results to appear, with the facets object at the bottom, containing a data array with a set of values and their respective counts.
...
"facets": {
"states": [
{
"type": "value",
"data": [
{
"value": "California",
"count": 8
},
{
"value": "Alaska",
"count": 5
},
{
"value": "Utah",
"count": 4
},
{
"value": "Colorado",
"count": 3
},
{
"value": "Washington",
"count": 3
}
]
}
]
}
The other piece of documentation is more conceptual; it's written in guide format, as opposed to the mechanical summary within the reference. You can read it here: https://swiftype.com/documentation/app-search/guides/facets.
It might be helpful to share some queries that you are trying to assemble.
Hopefully we can get to the bottom of this.
Enjoy the day,
Kellen