private static void UploadDocuments(SearchIndexClient indexClient)
        {
            var documents =
                new Hotel[]
                {
                    new Hotel()
                    { 
                        HotelId = "1058-441", 
                        HotelName = "Fancy Stay", 
                        BaseRate = 199.0, 
                        Category = "Luxury", 
                        Tags = new[] { "pool", "view", "concierge" }, 
                        ParkingIncluded = false, 
                        LastRenovationDate = new DateTimeOffset(2010, 6, 27, 0, 0, 0, TimeSpan.Zero), 
                        Rating = 5, 
                        Location = GeographyPoint.Create(47.678581, -122.131577)
                    },
                    new Hotel()
                    { 
                        HotelId = "666-437", 
                        HotelName = "Roach Motel",
                        BaseRate = 79.99,
                        Category = "Budget",
                        Tags = new[] { "motel", "budget" },
                        ParkingIncluded = true,
                        LastRenovationDate = new DateTimeOffset(1982, 4, 28, 0, 0, 0, TimeSpan.Zero),
                        Rating = 1,
                        Location = GeographyPoint.Create(49.678581, -122.131577)
                    },
                    new Hotel() 
                    { 
                        HotelId = "970-501", 
                        HotelName = "Econo-Stay",
                        BaseRate = 129.99,
                        Category = "Budget",
                        Tags = new[] { "pool", "budget" },
                        ParkingIncluded = true,
                        LastRenovationDate = new DateTimeOffset(1995, 7, 1, 0, 0, 0, TimeSpan.Zero),
                        Rating = 4,
                        Location = GeographyPoint.Create(46.678581, -122.131577)
                    },
                    new Hotel()
                    { 
                        HotelId = "956-532", 
                        HotelName = "Express Rooms",
                        BaseRate = 129.99,
                        Category = "Budget",
                        Tags = new[] { "wifi", "budget" },
                        ParkingIncluded = true,
                        LastRenovationDate = new DateTimeOffset(1995, 7, 1, 0, 0, 0, TimeSpan.Zero),
                        Rating = 4,
                        Location = GeographyPoint.Create(48.678581, -122.131577)
                    },
                    new Hotel() 
                    { 
                        HotelId = "566-518", 
                        HotelName = "Surprisingly Expensive Suites",
                        BaseRate = 279.99,
                        Category = "Luxury",
                        ParkingIncluded = false
                    }
                };

            try
            {
                indexClient.Documents.Index(IndexBatch.Create(documents.Select(doc => IndexAction.Create(doc))));
            }
            catch (IndexBatchException e)
            {
                // Sometimes when your Search service is under load, indexing will fail for some of the documents in
                // the batch. Depending on your application, you can take compensating actions like delaying and
                // retrying. For this simple demo, we just log the failed document keys and continue.
                Console.WriteLine(
                    "Failed to index some of the documents: {0}",
                    String.Join(", ", e.IndexResponse.Results.Where(r => !r.Succeeded).Select(r => r.Key)));
            }

            // Wait a while for indexing to complete.
            Thread.Sleep(2000);
        }
        private static void UploadDocuments(SearchIndexClient indexClient)
        {
            var documents =
                new Hotel[]
            {
                new Hotel()
                {
                    HotelId            = "1058-441",
                    HotelName          = "Fancy Stay",
                    BaseRate           = 199.0,
                    Category           = "Luxury",
                    Tags               = new[] { "pool", "view", "concierge" },
                    ParkingIncluded    = false,
                    LastRenovationDate = new DateTimeOffset(2010, 6, 27, 0, 0, 0, TimeSpan.Zero),
                    Rating             = 5,
                    Location           = GeographyPoint.Create(47.678581, -122.131577)
                },
                new Hotel()
                {
                    HotelId            = "666-437",
                    HotelName          = "Roach Motel",
                    BaseRate           = 79.99,
                    Category           = "Budget",
                    Tags               = new[] { "motel", "budget" },
                    ParkingIncluded    = true,
                    LastRenovationDate = new DateTimeOffset(1982, 4, 28, 0, 0, 0, TimeSpan.Zero),
                    Rating             = 1,
                    Location           = GeographyPoint.Create(49.678581, -122.131577)
                },
                new Hotel()
                {
                    HotelId            = "970-501",
                    HotelName          = "Econo-Stay",
                    BaseRate           = 129.99,
                    Category           = "Budget",
                    Tags               = new[] { "pool", "budget" },
                    ParkingIncluded    = true,
                    LastRenovationDate = new DateTimeOffset(1995, 7, 1, 0, 0, 0, TimeSpan.Zero),
                    Rating             = 4,
                    Location           = GeographyPoint.Create(46.678581, -122.131577)
                },
                new Hotel()
                {
                    HotelId            = "956-532",
                    HotelName          = "Express Rooms",
                    BaseRate           = 129.99,
                    Category           = "Budget",
                    Tags               = new[] { "wifi", "budget" },
                    ParkingIncluded    = true,
                    LastRenovationDate = new DateTimeOffset(1995, 7, 1, 0, 0, 0, TimeSpan.Zero),
                    Rating             = 4,
                    Location           = GeographyPoint.Create(48.678581, -122.131577)
                },
                new Hotel()
                {
                    HotelId         = "566-518",
                    HotelName       = "Surprisingly Expensive Suites",
                    BaseRate        = 279.99,
                    Category        = "Luxury",
                    ParkingIncluded = false
                }
            };

            try
            {
                indexClient.Documents.Index(IndexBatch.Create(documents.Select(doc => IndexAction.Create(doc))));
            }
            catch (IndexBatchException e)
            {
                // Sometimes when your Search service is under load, indexing will fail for some of the documents in
                // the batch. Depending on your application, you can take compensating actions like delaying and
                // retrying. For this simple demo, we just log the failed document keys and continue.
                Console.WriteLine(
                    "Failed to index some of the documents: {0}",
                    String.Join(", ", e.IndexResponse.Results.Where(r => !r.Succeeded).Select(r => r.Key)));
            }

            // Wait a while for indexing to complete.
            Thread.Sleep(2000);
        }