Dataset
The dataset contains 3000+ of the biggest airports in the world.JSON
_geoloc
attribute.
Initialize the client
Configure index settings
Even if you just want to sort by distance to a location, your textual relevance should also be good so that users can refine the search with a query. To do that, you must configure the index.Searchable attributes
The searchable attributes are:name
, city
, country
, and iata_code
.
Custom ranking
Algolia will use an airport’s number of connected airports as a ranking metric. The more connections, the better.Filtering inside a rectangle area
The USA can be considered as a polygon:
insideBoundingBox
parameter:
- 49.067996905313834, 65.73828125
- 25.905859247243498, 128.8046875
''
) returns all matching airports.