Hi Team, Iam facing typesense Facet Count Discrep...
# community-help
v
Hi Team, Iam facing typesense Facet Count Discrepancy Between Environments I'm experiencing inconsistent facet counts between two environments and need help understanding the root cause. Environment Details • DFX Environment: Single node (no cluster setup) • Client Environment: Clustered setup Issue Description When performing identical searches with different query parameters, I'm getting different facet counts for what should be the same data. Case 1: Wildcard Query (
q: "*"
)
Copy code
{
  "query_by": "system.lf.file.properties.template",
  "q": "*",
  "facet_by": "system.lf.file.properties.template.template_fields.Client Name_str",
  // ... other parameters
}
Result:
Client Name_str
facet shows "Baskin Robins Investment Ltd." with count 108,277 Case 2: Specific Query (
q: "Baskin Robins Investment Ltd."
)
Copy code
json
{
  "query_by": "system.lf.file.properties.template",
  "q": "Baskin Robins Investment Ltd.",
  "facet_by": "system.lf.file.properties.template.template_fields.Client Name_str",
  // ... other parameters
}
Result: Same field shows "Baskin Robins Investment Ltd." with count 108,277 (consistent) The Problem In our client environment (clustered setup): • Case 1 (
q: "*"
): Facet count for "Baskin Robins Investment Ltd." is correct (matches DFX environment) • Case 2 (
q: "Baskin Robins Investment Ltd."
): Facet count for "Baskin Robins Investment Ltd." is significantly reduced This suggests that when searching for a specific value, the clustered environment is not returning all matching documents in the facet aggregation, even though the wildcard search works correctly. Field name in client environment:
system.lf.file.properties.template.template_fields.Client Name List_str
Questions 1. Could there be an issue with how specific query terms affect facet aggregation in clustered environments? 2. Is this a known behavior where
q: "*"
and
q: "specific term"
produce different facet counts for the same field value? 3. Could cluster node distribution cause some documents to be missed during facet aggregation when using specific search terms? 4. Are there differences in how search context affects facet counting between single-node and clustered setups? 5. Could the field name difference (
Client Name_str
vs
Client Name List_str
) be related to this behavior? Additional Context • Same query structure and parameters • Same filter:
dfx_restricted_document:!= deleted
• Only difference is the environment architecture (single vs clustered) Any insights would be greatly appreciated!
f
Are both instances running on the same version of Typesense?
v
Yes both instances running on the same version 26.0
f
There must be some differences in either dataset / the collection itself, or any curation / overrides rules that apply. Anyhow,
v26.0
is more than a year old now, we'd suggest upgrading to at least
v28.0
on both instances and see if that alone fixes it
v
ok let me upgrade both instance and check