Update code to manage exact result as first result when existing #193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Return exact match(es) first when no boost e.g by population as scoring algorithm does not rank more exact matches than other case e.g scoring for search "mont" is not higher than the one with montagne a subset of mont.
PR only work for single name and is untested with compound cities names like something like
Aix-Les-Bains
as we would need to manage multiples terms and separators in this case.The other options to maybe adopt later on will be to upgrade Lunr to 2.X version. It may causes other issues due to some changes https://lunrjs.com/guides/searching.html