Skip to content

distinct is not applied in all cases when using hybrid or federated search #5526

@dureuill

Description

@dureuill

Describe the bug
The distinct search parameter or index setting are not applied on top of the final list of results, when using hybrid of federated search, possibly resulting in multiple documents with the same value for the distinct attribute being returned by the search.

To Reproduce
Steps to reproduce the behavior:

  1. Perform a hybrid search with a distinct attribute, such that there exist two documents that are respectively a hit for the full text search and for the semantic search, but not for the other, while sharing the same value in the distinct field.
  2. Observe that both documents are part of the results.

Expected behavior
No two documents should have the same value in the distinct field in results.

Meilisearch version:
Reported in v1.13, but affects all versions of Meilisearch since v1.6 and up to v1.14 at the time of writing

Additional context

Internal report: https://github.com/meilisearch/meilisearch-support/issues/862

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions