Geotrek-admin
Geotrek-admin copied to clipboard
API v2 : Different search results depending on whether the terms are accented or not
When running the same text search query with and without accents, the API returns different results.
For example: https://rando.ecrins-parcnational.fr/search?text=velo and https://rando.ecrins-parcnational.fr/search?text=v%C3%A9lo
It would probably be interesting not to differentiate between accented and non-accented queries.
Using postgres UNACCENT extension, we would be able to filter using <icontains|istartswith>__unaccent= in queryset lookups.
But this is another extension to manually activate
Why not, it would be done for everyone, and would be useful for the Schema export view that is easier to do with unaccent :
- https://github.com/PnX-SI/schema_randonnee/blob/master/geotrek/v_treks_schema.sql#L49
- https://github.com/PnX-SI/schema_randonnee/blob/master/geotrek/v_treks_schema.sql#L93