Addok plugin to support short city name as equal as full city name.
Some cities have composed names, some times long one, e.g. Adelans-et-le-Val-de-Bithaine. But long names are not in use in daily life.
Assuming autoclomplete as false. When you use the name of "Brive" in France you probably mean the city of "Brive-la-Gaillarde", but not the locality of "Brive" about the village of "Guenrouet".
Add addok_usage_name_BAN_FR.make_labels
in place of the default addok.helpers.results.make_labels
or addok_france.make_labels
.
SEARCH_RESULT_PROCESSORS_PYPATHS = [
...
'addok_usage_name_BAN_FR.make_labels',
...
On query this plugin rewrite the result from Addok search by replacing each result label by possible subpart of the name splited on "-".
Example:
input: Adelans-et-le-Val-de-Bithaine
matchable output: Adelans-et-le-Val-de-Bithaine, Adelans-et-le-Val, Adelans