#community-help

Retrieving Facets of a Collection

TLDR Digamber inquired about retrieving all facets of a collection. Kishore Nallan suggested using the collection summary endpoint, looping through the fields, and caching the results.

Powered by Struct AI
7
13mo
Solved
Join the chat
Sep 21, 2022 (13 months ago)
Digamber
Photo of md5-a0246423746b3b51425d05cfd9c494ae
Digamber
10:39 AM
Hey Guys,
Is there a way to retrieve all the facets of a collection
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:41 AM
Hit the collection summary end-point and go through all the returned fields, checking for facet: true
Digamber
Photo of md5-a0246423746b3b51425d05cfd9c494ae
Digamber
10:52 AM
Hi yes, was hoping to get a better endpoint, as id have to loop through all the fields, which isnt ideal.

Maybe an idea for the future ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:56 AM
Looping should be pretty cheap? You can maybe loop and cache it once and then reuse for future requests.
Digamber
Photo of md5-a0246423746b3b51425d05cfd9c494ae
Digamber
10:56 AM
That is the plan, just wanted to avoid the excess if possible
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:57 AM
So far, nobody has asked for this: if this comes up often, will consider.
Digamber
Photo of md5-a0246423746b3b51425d05cfd9c494ae
Digamber
10:58 AM
Thanks, appreciate it