Hi All, We have multiple fields with int[ ] type ...
# community-help
c
Hi All, We have multiple fields with int[] type that are set to facet=True, problem is when we use facet, the response time takes around 4s but without facet it only takes 100ms, is there a way to optimize the facet?
k
You can try doing estimation of facets via the
facet_sample_percent
and
facet_sample_threshold
parameters.
c
read about it, but it will not return exact count, right?
k
Yes, it's a tradeoff between performance and speed. With
facet_sample_threshold
the counts will be accurate when small number of hits are found, but for larger results, estimation is done.
c
@Kishore Nallan from the documentation, it says facet sampling is disabled by default, will it be enabled by adding either of these 2
facet_sample_threshold
and
facet_sample_percent
?
k
Yes
c
sorry, just to confirm,
facet_sample_threshold
if I set this to
10
and I only return
15
per page with
found=1000
, will it apply sampling on facet?
k
Yes that should apply sampling.
c
@Kishore Nallan
facet_sample_threshold
didn't help, still experiencing slow response time due to facet (from array of integers), is there a way where it will improve by increasing resources i.e. RAM, CPU or DISK? I mean the processing of facet, is it on the CPU side or other?
k
It's CPU bound, so a larger machine will help. Are you using Typesense cloud or self hosting?
c
@Kishore Nallan cloud
k
Can you DM me your cluster ID and the exact query that you are trying? I can take a look and get back to you.
c
@Kishore Nallan for the cluster id, you're referring to the node or host id, right?