Skip to content

POI Search Ranking

The ranking criteria for the POI search algorithm are as follows in descending priority:

  • Title exact match with query
  • Title starts with query
  • Title words start with query
  • Title contains contents of query, this uses fuzzy search. (See below)
  • Keywords contain text of query
  • Description contains text of query
  • Type contains text of query

Points of interest that match criteria with the same priority are sorted by approximate distance if location is available, otherwise they are sorted alphabetically based on title.

Points of interest in a group are also sorted by distance if location is available.

The “distance” mentioned in the previous steps, are calculated based taking in account transitions and walking speed of a person.

Normalization

The input to search, and the strings that are searched against (titles, descriptions, keywords, etc) are normalized.

The normalization process includes translation of accent characters:

'à' => "a", 'á' => "a", 'â' => "a", 'ä' => "a", 'æ' => "a", 'ã' => "a", 'å' => "a", 'ā' => "a",
'À' => "a", 'Á' => "a", 'Â' => "a", 'Ä' => "a", 'Æ' => "a", 'Ã' => "a", 'Å' => "a", 'Ā' => "a",
'ç' => "c", 'ć' => "c", 'č' => "c", 'Ç' => "c", 'Ć' => "c", 'Č' => "c", 'è' => "e", 'é' => "e",
'ê' => "e", 'ë' => "e", 'ē' => "e", 'ė' => "e", 'ę' => "e", 'È' => "e", 'É' => "e", 'Ê' => "e",
'Ë' => "e", 'Ē' => "e", 'Ė' => "e", 'Ę' => "e", 'î' => "i", 'ï' => "i", 'í' => "i", 'ī' => "i",
'į' => "i", 'ì' => "i", 'ı' => "i", 'Î' => "i", 'Ï' => "i", 'Í' => "i", 'Ī' => "i", 'Į' => "i",
'Ì' => "i", 'I' => "i", 'ł' => "l", 'Ł' => "l", 'ñ' => "n", 'ń' => "n", 'Ñ' => "n", 'Ń' => "n",
'ô' => "o", 'ö' => "o", 'ò' => "o", 'ó' => "o", 'œ' => "o", 'ø' => "o", 'ō' => "o", 'õ' => "o",
'Ô' => "o", 'Ö' => "o", 'Ò' => "o", 'Ó' => "o", 'Œ' => "o", 'Ø' => "o", 'Ō' => "o", 'Õ' => "o",
'ß' => "s", 'ś' => "s", 'š' => "s", 'Ś' => "s", 'Š' => "s", 'û' => "u", 'ü' => "u", 'ù' => "u",
'ú' => "u", 'ū' => "u", 'Û' => "u", 'Ü' => "u", 'Ù' => "u", 'U' => "u", 'Ū' => "u", 'ÿ' => "y",
'Ÿ' => "y", 'ž' => "z", 'ź' => "z", 'ž' => "z", 'Ž' => "z", 'Ź' => "z", 'Ż' => "z", 'ğ' => "g",
'Ğ' => "g", '&' => " and ", '¿' => "?"
  • Symbols are removed except { + - ! ? < > : " ( ) * { } [ ] % ^ @ $.
  • Alphanumeric characters are converted to lowercase.
  • Multiple whitespaces are converted to single whitespace.
  • Non-latin characters are kept as is.

Fuzzy Search for Titles

Fuzzy search is only carried out when the titles of Pois contain the contents (i.e. characters) from the query string. The SDK does not calculate the string distance between the query strings and all the titles/description/keyword/type pairs.

As an example, consider the following search term and results:

As seen in this example, the search term of “fou” is searched in the title of the pois in a fuzzy manner and the results are returned back to the user.


Last update: March 26, 2024
Back to top