#community-help

TS Response Indicates Incorrect Document Count

TLDR Manish encounters a discrepancy in document count when running search query on TS. Jason asks about scoped API key and num_documents; Manish needs to check.

Powered by Struct AI
Jun 02, 2023 (4 months ago)
Manish
Photo of md5-f0a83cd20895941fd74c026f9f15b61f
Manish
01:43 AM
I run empty search query just to check how many docs I have. I get this response from TS. But, I know that I only have 10 docs in there -- and it's confirmed by piping the response through jq '.hits[].document.id' | wc -l. Why does TS say "out_of" 19, when only 10 docs exist?

  "out_of": 19,
  "page": 1,
  "request_params": {
    "collection_name": "threads",
    "per_page": 64,
    "q": ""
  },
  "search_cutoff": false,
  "search_time_ms": 3
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:26 AM
When you do GET /collections what does num_documents say?
02:26
Jason
02:26 AM
Also are you using a scoped API key by any chance?
Manish
Photo of md5-f0a83cd20895941fd74c026f9f15b61f
Manish
03:50 AM
I’ll have to check that. Away from desk.