Ask a RAG system “how many customers asked for a refund?” and it counts the ten passages it retrieved. StackGrep's count reads every candidate and returns the exact number of matching documents, with a sample of their ids, in one call.
count_collection({ collection: "tickets", query: "refund", filter: "month:2026-09" })
→ {"docs": 1284, "sample": ["t-88120", "t-88131", ...]}count_collection(query: "refund", filter: "month:2026-09")count_collection(query: "automatically renew")count_collection(query: "TLSv1(\.0)?[^.0-9]", regex: true)Exact for your collections: every candidate is checked, and only documents that really match (and pass your filter) are counted.
Usually milliseconds to a few hundred milliseconds, depending on how many documents contain the words you're counting.
Yes: add a filter like customer:globex or month:2026-09, and run one count per value you want to compare.
StackGrep Engine is onboarding teams from the waitlist. Bring your documents or your bucket.