Geotrek-admin icon indicating copy to clipboard operation
Geotrek-admin copied to clipboard

API v2 : Different search results depending on whether the terms are accented or not

Open dtrucs opened this issue 3 years ago • 2 comments

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.

dtrucs avatar Jan 19 '22 17:01 dtrucs

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

submarcos avatar Jan 20 '22 08:01 submarcos

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

camillemonchicourt avatar Jan 20 '22 09:01 camillemonchicourt