-
Notifications
You must be signed in to change notification settings - Fork 5
add autocompletion support to OSM Scout geocoder #47
Conversation
|
title/label: OK, no problem, I can merge then full address into the label. Then we have title: for POI display If this is OK, I'll make the change and update PR Re Pelias: probably. I think I will still keep libpostal parsing and, one can always hope, it may educate users about parsing of their queries. But even with this flaw, I think the autocomplete is a very useful feature. PS: Come winter, and we all will enjoy slightly warmer phones while typing our search queries! |
That |
The label has been adjusted accordingly. Just stumbled on an issue: when entering some bogus string, autocomplete keeps trying to search for it when the returned results are empty |
Autocomplete currently runs on a timer, once per second, unless there's an existing call in progress. Maybe I could limit that when the query hasn't changed, but providers should do their own caching anyway. |
That's a tricky one. Results are cached, but only if we get hits (I think the same goes for all providers, most of the core code is the same among providers):
Which, for the search, is a good default. For example, network was done (for online providers) or maps were missing (osm scout) or something else. So, after resolving such external issue, user can try again by pressing search. For autocomplete though, we start spamming the search provider if the search string gets zero responses. So, to avoid it, maybe we should call autocomplete only if the query has changed when compared to the previous try. Then users can still hit the search if the full query was entered. |
Yes, I'll make this change. But, still, I think you should fix your caching. It's very common on mobile to do typos and hitting backspace should not trigger a network request either. You could just simply save all autocomplete results
|
Thanks for quick copy-and-paste guide! I have added it to the geocoder |
This seems to be working. Several issues/questions:
expected: when you type partial name of the city/country, libpostal may not recognize it and place it under category house (so, way off in hierarchy). To assist, users would have to enable primitive parser and add
,
in the search string. Or use this feature mainly to quickly find some restaurant by its name.unexpected: Looks like
filterCompletions
throws out results which may be valid, but not in its understanding. For example, searching for "Tallink Stockholm" would return "Tallink-Silja Line, Östermalms stadsdelsområde, Stockholm, Stockholm County, Svealand, 115 41, Sverige" with the title and label "Tallink-Silja Line, Östermalms stadsdelsområde". I wonder if there should be a property that would force to accept the completion if its coming from the geocoder? Notice that since we could search for Sweden and get Sverige in response. So, I would have trusted geocoder more than the text based filtering.Question: What is the difference between
title
andlabel
? In my case, I just put them the same.I presume we need to resolve the issues before merging...