You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if it there was a way to retrieve the name that matched the query, like a new "matched_name_position" attribute :
// Pour /search/?q=ecole+anne+frank
"properties": {
"label" : "Ecole Anne Frank 93250 Villemomble"
"name" : ["Ecole Anne Frank", "Ecole de la Carrière", "Ecole du Parc"],
"matched_name_position" : 0,
"postcode" : "93250",
"city" : "Villemomble"
...
}
// Pour /search/?q=ecole+carriere
"properties": {
"label" : "Ecole Anne Frank 93250 Villemomble"
"name" : ["Ecole Anne Frank", "Ecole de la Carrière", "Ecole du Parc"],
"matched_name_position" : 1,
"postcode" : "93250",
"city" : "Villemomble"
...
}
// Pour /search/?q=ecole+du+parc
"properties": {
"label" : "Ecole Anne Frank 93250 Villemomble"
"name" : ["Ecole Anne Frank", "Ecole de la Carrière", "Ecole du Parc"],
"matched_name_position" : 2,
"postcode" : "93250",
"city" : "Villemomble"
...
}
Thus, we would be able, in our front app, to display the "matched name" whenever the matched_name_position value is greater than 0 :
var customLabel = result.properties.name[0];
var matchedNamePosition = result.properties.matched_name_position;
if(matchedNamePosition > 0){
var matchedName = result.properties.name[matchedNamePosition]
customLabel += ' (anc. ' + matchedName + ')'
}
// Pour /search/?q=ecole+anne+frank, customLabel = "Ecole Anne Frank"
// Pour /search/?q=ecole+carriere, customLabel = "Ecole Anne Frank (anc. Ecole de la Carrière)"
// Pour /search/?q=ecole+du+parc, customLabel = "Ecole Anne Frank (anc. Ecole du Parc)"
It would be great if it there was a way to retrieve the name that matched the query, like a new "matched_name_position" attribute :
Thus, we would be able, in our front app, to display the "matched name" whenever the matched_name_position value is greater than 0 :
Originally posted by @AdrienVH-c2c in #617 (comment)
The text was updated successfully, but these errors were encountered: