transitio.index.suggest#
- transitio.index.suggest(prefix, *, limit=10, kinds=None, country=None, lang=None, index=None)#
Type-ahead: the places whose labels start with
prefix, ranked.Every label a place carries counts — its name, its names in other languages and its aliases — normalised as
place()normalises a query, sohelsandhelsingfboth reach Helsinki. Places rank by an exact label first, then kind precedence asplaces()ranks it, the label’s source (the name, a name in the place’s own languages or English, an alias, a name in another language), more feeds, the label and the id; oneSuggestionper place, at mostlimit.kindskeeps only those kinds,countryone ISO code or several, andlangpicks the label to show (the place’s name in that language when it has one, else its name). An empty prefix suggests nothing. The index’s labels are sorted once, on the first call over it.