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

Break score ties in patient search results #320

Closed
make-github-pseudonymous-again opened this issue Aug 16, 2021 · 1 comment
Closed

Break score ties in patient search results #320

make-github-pseudonymous-again opened this issue Aug 16, 2021 · 1 comment
Labels
bug Something isn't working feature/patients This issue is about the patients functionality feature/search This issue is about searching the data in general ux This issue is about the user experience in general.

Comments

@make-github-pseudonymous-again
Copy link
Contributor

Currently sorted order of results can change if their score is the same. Then pagination is difficult to work with because an item could appear on different pages with the same text query and database state. This can happen for instance when going from page 1 to page 2 of the results. To make this predictable we need to use a compound index to break ties. Maybe {...textIndexFields, lastname: 1, firstname: 1, niss: 1, birthdate: 1}. See https://docs.mongodb.com/manual/core/index-text/#std-label-text-index-compound and https://stackoverflow.com/questions/31652975/mongodb-how-to-do-a-text-search-and-sort-by-a-date.

@make-github-pseudonymous-again make-github-pseudonymous-again added bug Something isn't working feature/patients This issue is about the patients functionality ux This issue is about the user experience in general. feature/search This issue is about searching the data in general labels Aug 16, 2021
@make-github-pseudonymous-again
Copy link
Contributor Author

Or {...textIndexFields, lastModifiedAt: -1, lastname: 1, firstname: 1, niss: 1, birthdate: 1}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature/patients This issue is about the patients functionality feature/search This issue is about searching the data in general ux This issue is about the user experience in general.
Projects
None yet
Development

No branches or pull requests

1 participant