To get autocomplete results like you see on hotels.com (screenshot below) with multiple types of possible matches including landmarks, hotels, cities, neighborhoods, and airports, use our relational database files.
Hotels.com:
This page http://developer.ean.com/database_catalogs/relational/Geography_Data provides the URL for downloading regionEANHotelIDMapping (a file containing a map of all the hotels in each region type) and provides the URL you can use to download all of the region files for neighborhoods, airports, landmarks, and cities.
Each region type file on that page (airports, cities, etc) contains a regionID for each record.
This file lists all hotels:
https://www.ian.com/affiliatecenter/include/V2/ActivePropertyList.zip
The field types for the list of all hotels are documented here:
http://developer.ean.com/database_catalogs/relational/Property_Data
Practical use of the files:
1. When the user starts typing, query the table(s) that contain the destinations and hotel names (cities, neighborhoods, airports, landmarks, and hotels)
2. Show the matches, highlight the typed letters in each match
3. obtain regionID from the region selected by the user
4. use regionID to find list of hotel ID numbers using RegionEANHotelIDMapping table
When the user selects a city, neighborhood, airport, or landmark, you will then know the corresponding regionID. Query regionEANHotelIdMapping for a list of the hotelID numbers in that region.
One you have the list of hotelID numbers for hotels that are in the region, you can send a request to EPS to find out which of those properties are available for the dates of stay entered by your customer.
To do so, send an EPS API HotelList request using the <hotelList> element containing a list of all hotelIds in that regionID:
http://developer.ean.com/docs/read/hotels/version_3/request_hotel_list
This file contains the translations for all regions. You must change the xx_XX part of the URL to one of the values in the table below
https://www.ian.com/affiliatecenter/include/V2/RegionList_xx_XX.zip
example, for Spanish use: https://www.ian.com/affiliatecenter/include/V2/RegionList_es_ES.zip
As the customer types, you will need to query the multi-language file. This will make categorization of the matched regions difficult because there is no “type” specification in the multi-language file. You would need to query the other files as well for categorization in this case.
Available in these languages: | ||||||
ar_SA | es_ES | fr_FR | it_IT | ja_JP | tr_TR | |
cs_CZ | es_MX | hr_HR | ko_KR | no_NO | ru_RU | uk_UA |
da_DK | et_EE | hu_HU | lt_LT | nl_NL | sk_SK | vi_VN |
de_DE | fi_FI | in_ID | lv_LV | pl_PL | sv_SE | zh_CN |
el_GR | fr_CA | is_IS | ms_MY | pt_BR | th_TH | zh_TW |
Comments
0 comments
Please sign in to leave a comment.