typesense / typesense

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences
https://typesense.org
GNU General Public License v3.0
21.31k stars 661 forks source link

Wrong facet count, appear duplicated in response #2083

Open pvujic opened 2 days ago

pvujic commented 2 days ago

Description

Facet counts are appearing duplicated and return a wrong facet count

Steps to reproduce

Search we do:

{
  "searches": [
    {
      "query_by": "name,description",
      "collection": "prod_products_es",
      "q": "*",
      "facet_by": "*",
      "filter_by": "category:=[`Inodoros`] && alimentaci__n_de_la_toma_de_agua__inodoros__facet:=[`[de alimentación] inferior`]",
      "max_facet_values": 20,
      "page": 1,
      "per_page": 48
    }
  ]
}

image

For some reason in the returned response the facet appears duplicated with two different counts, when we do the sum of both 39 + 75 we get the correct result of 114: image

*This only happens on some occasion but always on the same facets

Expected Behavior

de alimentación inferior: 114 de alimentación lateral (superior): 52

Actual Behavior

de alimentación inferior: 39 de alimentación lateral (superior): 14

Metadata

Typesense Version: 26.0

OS: Ubuntu 24.04 LTS (GNU/Linux 6.8.0-1017-aws aarch64)

kishorenc commented 1 day ago

Can you please try on v27.1? There have been some bug fixes.

pvujic commented 1 day ago

Just updated to v27.1, same issue.