When hybrid search is enabled, `estimatedTotalHits` equals total index document count and facets ignore the query

Author: nour-3abdouCreated Aug 17, 2026Updated Aug 17, 2026

Describe the bug

When hybrid search is enabled, estimatedTotalHits can become equal to the total number of documents in the index, even when the query is selective and should match only a subset of documents.

The same query with text search only returns a reasonable totalHits.

This also affects sorting and facets: facet distributions can return counts corresponding to the entire index, effectively ignoring the query. For an e-commerce use case, this means facets such as brands and categories can show counts for documents that are not relevant to the current query.

To Reproduce

Steps to reproduce the behavior:

  1. Create an index containing approximately 60,000 documents with both Arabic and English searchable attributes.

  2. Perform a text-only search, for example:

    {
      "q": "مكيف سامسونج"
    }
    
  3. Observe the returned totalHits and facet distribution.

  4. Perform the same search with hybrid search enabled:

    {
      "q": "مكيف سامسونج",
      "hybrid": {
        "semanticRatio": 0.7,
        "embedder": "Embedder large"
      }
    }
    
  5. Observe that estimatedTotalHits can become approximately equal to the entire index size (~60,000).

  6. Observe that facet counts can also represent the entire index rather than documents matching the query.

  7. Repeat with English queries and observe that the behavior is not limited to Arabic.

  8. Add a rankingScoreThreshold and observe that, for some queries, estimatedTotalHits and facet counts become more reasonable.

Expected behavior

estimatedTotalHits should provide a meaningful estimate of the documents matching the query.

Facet distributions should also be calculated from the documents matching the current query, as they are with text search.

Enabling hybrid search should not cause the search to effectively report or facet over the entire index for a selective query.

Meilisearch version:

v1.53.0

Additional context

  • Searchable attributes contain both Arabic and English content.
  • Embedder: OpenAI text-embedding-3-large.
  • rankingScoreThreshold is not used in production because it causes a significant performance impact. Some requests take more than 30 seconds when it is enabled.
  • Interestingly, adding rankingScoreThreshold fixes the estimatedTotalHits and facet counts for some queries, which suggests that the issue may be related to how the hybrid candidate set is used for total-hit and facet calculation.
  • I understand that rankingScoreThreshold is applied to the score before the semanticRatio weighting is applied, so I am not expecting it to filter based on the final weighted hybrid score.
  • The issue is not limited to Arabic queries. The index contains both Arabic and English attributes, and the behavior can also be reproduced with English queries.
  • With text search only, the response uses totalHits and the value/facets are correctly scoped to the query. With hybrid search, the response uses estimatedTotalHits, which can become equal to the entire index size, and the facet distributions can similarly appear to represent all documents.

This makes the issue particularly problematic for e-commerce search, where facet counts for brands, categories, price ranges, etc. need to reflect the current query.