#community-help

Customizing Multi Search API Response

TLDR gab inquired about customizing the search response to only display "facet_counts". Kishore Nallan provided a solution - setting per_page=0.

Powered by Struct AI
4
27mo
Solved
Join the chat
Oct 12, 2021 (27 months ago)
gab
Photo of md5-8be2a24edf7a95c9c74abce4b1130c3e
gab
06:40 AM
Hi, is there a way to dry a bit the search response. I would like to get only properties relevant for building a facet search.
I would like to stripe out the "hits" property and to keep only the "facet_counts" property in the response.
Here is the current parameters I'm sending to the multi_search api
{
  "searches": [
    {
      "query_by": "name, canton",
      "collection": "warehouses",
      "q": "",
      "facet_by": "canton",
      "filter_by": ""
    }
  ]
}
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:41 AM
Yes, set per_page=0
gab
Photo of md5-8be2a24edf7a95c9c74abce4b1130c3e
gab
06:43 AM
Ah perfect 🙂 thanks !
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:43 AM
:yw: