0

When sending a request to https://autocomplete.geocode.ls.hereapi.com/6.2/suggest.json?query=Вильнюс with an indication of cyrillic nothing comes and with a latin https: //autocomplete.geocode.ls.heraapi.com/6.2/suggest.json?query=Viln all is well. Tell me what the problem is or what I'm doing wrong?

  • Please provide more details about the issue you're having like the expected vs the actual result; it's unclear what you mean by "nothing comes". I tried both your requests and everything looks normal. – astro.comma Dec 25 '21 at 23:33
  • Thank you for paying attention to my problem. Here is my request https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json?apiKey=a...a&query=вильн&language=ru&maxresults=10. In response, all anything except "Вильнюс", that is, the cities of Vilnius The same situation for example with the city Кишинёв (Kishinev) – Вадим Т Dec 28 '21 at 09:14
  • I suggest you edit your original question above to include these additional details; it will help people who might come here in the future to better understand the issue. – astro.comma Dec 29 '21 at 01:00
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jan 02 '22 at 14:40
  • I edited what exactly can I change? – Вадим Т Jan 12 '22 at 16:00

1 Answers1

0

You're not doing anything wrong. Autocomplete is designed to give you addresses that contain (perfectly match) your input string, and the results are sorted by relevance.

When you make your query in russian and provide only "Вильнюс" as input, the service is finding a lot of results (street names) that it considers are more relevant than the city. The city name is also found, but since the service doesn't think that this is what you're searching for, it puts the city much lower in the results list. You don't see it because you're limiting your query to give you only the first 10 matches (with the maxresults=10 parameter), but if you change the maxresults parameter to 20, for example, you will see that Vilnius appears in the 16th place of the API response.

If you want the service to better understand what is the thing you're querying for, you'll need to provide additional information. For example, if you continue typing and your input string is now "Вильнюс " (with a space at the end) or "Вильнюс Л" (a space and another letter), the service will understand what you mean and will return the result you want.

Another way of providing more information to change the way the service ranks the results is by adding a spatial filter, like the country, mapview, or prox parameters mentioned in the API Reference section of the documentation. Alternatively, the resultType parameter can help you filter out all the results with street names and return only city names, if that's what you want. These are just some options available, the one that is right for you will depend on your use case.

astro.comma
  • 181
  • 9