Searchkick count query

Viewed 97

Does Searchkick support the Count API? - https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html

Basically I am looking to do something like the following -

Product.search(where: { category_ids: [10] }).count

Or should I use aggregation for this? What would be the syntax for an aggregation query using Searchkick?

The important thing is, I wanna do this without retrieving the documents or all the _id's because the count could be in many thousands.

0 Answers
Related