Toggle navigation

Masterdatabase

<
  • Dashboard
  • Airports
  • Cities
  • Hotels
    • Hotel chains
    • Hotel descriptions
    • Hotel consolidated
    • Hotel crossreferences
  • Services
    • PluginController
    • HotelConsolidator
  • Reports

Help - HotelConsolidator service

  1. Home
  2. Help
  3. HotelConsolidator service

Summary

The role of the HotelConsolidation service is to transform the raw hoteldata (HotelDescription table) from the individual providers and consolidate them into the consolidation tables (HotelConsolidated and HotelCrossreference).
It will try to match the same hotel from different providers against each other, store only 1 instance and create cross-references for the matches. (one-to-many relationship).

Base hotel
An entry in the HotelConsolidated table is called the basehotel and contains 1 or more cross-references.

Unique hotel
A hotel is called a unique hotel if the hotel can or could not be matched against any other hotel. Or if the hotel provider is not allowed to be matched against other hotel providers (eg. Lido hotels)

Base Provider
There is a preferred hotel provider which is called the baseprovider. This hotel provider usually has the best hotel data to present in Serko Online and most likely also the most hotels available.
Currently this base provider is EAN, but this can be easily changed in the configuration of the service.

Logic summary

For every hotel in the HotelDescription table, it will try to match it against entries from the HotelConsolidated table.

New hotel:
If no match could be found, it will add it to the HotelConsolidated table and treat it as a unique hotel. (one-to-one relation; 1 HotelConsoldidated entry and 1 HotelCrossreference entry point to itself).
If it could be match against another hotel, it will determine if the new hotel is a baseprovider or not. If is not, it will only create a cross-reference. If it is a baseprovider, it will swap out the existing HotelConsolidated details with the preferred hoteldetails from the new hotel.
and create the cross-reference.

Updated hotel:
Only if the hotel is a basehotel, we will update the HotelConsolidated table with the details. If the hotel is a cross-reference only, we ignore it.

Inactive hotel:
Hotels come and go, so when a hotel has been marked as inactive by the HotelUpdater service, it needs to be removed from the consolidation tables.
If the hotel to be removed is a basehotel, a new basehotel will be nominated from the cross-reference table and the hotel details from the nominated hotel will be copied over from the HotelDescription table into the HotelConsolidated table.
If the hotel to be removed is a cross-reference only, it will only need to remove the cross-reference from the HotelCrossreference table.

Command parameters

Update:
Note, the command parameter "providers" has been replaced by appsetting "OnlyProcessProviderIds" as it was not that simple to run a windowsservice with 'normal' command parameters.
The command parameters implementation is still there to be used at a later stage if required.

Help

Synopsis: Serko.HotelConsolidator.WindowsService.exe [options]
 
Providers:
   -p, --providers <numbers> Only process selected provider(s).
   -p, --providers <names>    e.g. -p 2 7
   e.g. -p Sabre Expedia
 
Help:
   -?, --help The helpful overview you're reading now.

Examples

Galileo only

Serko.HotelConsolidator.WindowsService.exe --providers Galileo
Serko.HotelConsolidator.WindowsService.exe --providers 1

Sabre and Expedia

Serko.HotelConsolidator.WindowsService.exe --providers Sabre Expedia
Serko.HotelConsolidator.WindowsService.exe --providers 2 7

All providers

Serko.HotelConsolidator.WindowsService.exe

Configuration file

<appsettings>
<add key="BaseHotelProviderId" value="7" /> (Expedia)
<add key="BatchsizeNewHotelProcessor" value="50" />
<add key="BatchsizeUpdatedHotelProcessor" value="50" />
<add key="AnyHotelChainCode" value="1034" />
<add key="ProcessNewHotels" value="true" />
<add key="ProcessUpdatedHotels" value="true" />
<add key="ProcessInactiveHotels" value="true" />
<add key="OnlyProcessProviderIds" value="2" /> (comma seperated; to process all providers leave blank)
<add key="ServiceIntervalInHours" value="4" /> ( windows service interval in hours )
</appsettings>

NewHotel processor logic

For each hotel to process:

  • If hotel has existing cross-reference (must have been matched before)
    • change modified date, so it will be picked up by the Updated hotel processor
  • Else match hotel
    • If matches found
      • Handle match-result
    • Else
      • Add new unique hotel

UpdatedHotel processor logic

If hotel needs rematch
When a hotelprovider changes the hotelname, we set the NeedsRematch flag on the HotelDescription table. This will automatically unmatch the hotel and set the modified date in the future so it will be picked up for re-matching.

  • If hotel is linked to multiple crossreferences, then unmatch from other crossreferences
    • UnMatch()
      • Is hotel a basehotel, then re-assigned all related crossreferences to new consolidated hotel
        • CreateAndNominateConsolidatedHotelForCrossReferences()
      • Is hotel a crossreference only, then only create a consolidated hotel
        • CreateConsolidatedHotelForSingleCrossReference()
    • If hotel is a base hotel, then also update hotel details (on HotelConsolidated table)
      • UpdateConsolidatedBaseHotel()
  • If hotel is a unique hotel, then just update hotel details
    • UpdateConsolidatedBaseHotel()

  • ResetNeedsRematching()
  • UpdateDtModified1HourAhead() - so it will try to re-match it.
  • UpdateLastConsolidatedDateOnly()
Else if hotel is basehotel
  • Is hotel a unique hotel, then try to re-match it
    • MatchUpdatedHotel()
      • If match found, then add ...
        • AddHotelMatches()
          • hotel is baseprovider
            • SaveUpdatedMatchedBaseProvider()
              • Mark matchedhotel as obsolete by setting ReplacedWithHotel to new hotelconsolidatedId
              • Repoint all crossreferences from matchedhotels to new hotelconsolidatedId as new match hotel is a baseprovider
              • Update crossreference with matchingalgorithm
          • hotel is not a basehotel
            • SaveUpdatedMatchedNonBaseProvider()
              • Mark updated hotel as obsolete by setting ReplaceWithHotel to new hotelconsolidatedId
              • Repoint crossreference from updatedHotel to new hotelconsolidatedId
              • Update crossreference with matchingalgorithm
      • If no match found, then just update hotel details
        • UpdateConsolidatedBaseHotel()
  • if not a unique hotel (has crossreferences linked), then just update hotel details
    • UpdateConsolidatedBaseHotel()

InactiveHotel processor logic

Cleanup HotelDescription_Inactive table
Inactive hotels that were moved to HotelDescriptions_Inactive more than 12 months ago, will be removed as cleanup process.
ClearHotelDescriptionInactiveHotelsOlderThan();

    For each hotel to process:

    • If hotel is a basehotel and has multiple crossreferences against it, then unmatch it and nominate a new base hotel
      • _updatedHotelUnMatchRepository.CreateAndNominateConsolidatedHotelForCrossReferences()

    Common logic (if hotel is a crossreference only or an unique hotel)

    • Delete hotel from crossreference and hotelconsolidated table
      RemoveHotelFromHotelCrossReferenceAndHotelConsolidated()
    • Move inactive hotel from HotelDescription to HotelDescription_Inactive table
      MoveInactiveHotelToArchive()
    • Try and delete Address and GeoCode table entries
      CleanUpAddressAndGeoCode()
Cleanup inactive hotels from HotelDescription table
Delete inactive hotels in HotelDescription that dont have crossreference and hotelconsoldated entries, but have been consolidated once
ClearInactiveHotelDescriptionsWithMissingHotelCrossReferenceAndHotelConsolidated();

Post processor logic

At the end of every hotel consolidation run the postprocessor step gets executed.

    Update missing Geocodes from HotelDescription to HotelConsolidated table
    • The geocoder in the HotelUpdater service gets called at the end of the hotelupdate process and the current implementation does not update the dtModified column of HotelDescriptions
      Therefore this change does not get picked up by the HotelConsolidator service.
      This postprocessor step updates all HotelConsolidated hotels with missing geocodes from HotelDescriptions which have updated geocodes.

Consolidation schedule

The consolidator service only runs at configured time-slots.

Monday to Friday from:
  • midnight to 3am
  • 5am to midnight.
It does not consolidate daily between 3am and 5am and the entire weekend as at those times the on-demand sql jobs are running against the client SOL databases.

The schedule can be configured in the application config file of the webservice ( serko.hotelconsolidator.windowsservice\app.config)