Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DAT-63] fix: Inconsistent sort due to per-field limit #7

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

paultranvan
Copy link
Contributor

Flexsearch returns results grouped on matching field, for instance:

{
  "path": [doc1, doc2, ...],
  "name": [doc2, doc4, ...]
}

It enforces the limit on each field. Which mean we might end
up in a situation where a file is skipped from the name array, but
appear on the path array.
As we have a sort order making the results appear first when it has a match on the name compared to those with a match on the path, it can lead to inconsistent results display.

Therefore, we enforce our own limit restriction, after sorting.

Flexsearch returns results grouped on matching field, for instance:
```
{
  "path": [doc1, doc2, ...],
  "name": [doc2, doc4, ...]
}
```

It enforces the limit on each field. Which mean we might end
 up in a situation where a file is skipped from the `name` array, but
appear on the `path` array.
As we have a sort order making the results appear first when it has a
match on the `name` compared to those with a match on the `path`, it
can lead to inconsistent results display.

Therefore, we enforce our own limit restriction, after sorting.
@paultranvan paultranvan changed the title [DAT-63] fix: Limit was set on matching fields [DAT-63] fix: Inconsistent sort due to per-field limit Oct 28, 2024
@paultranvan paultranvan requested a review from Ldoppea October 29, 2024 09:44
@paultranvan paultranvan merged commit 05534bd into main Oct 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants