Exemplo n.º 1
0
        static void BuildIndex()
        {
            var movies = new Movie[]
            {
                new Movie("invernal-affairs")
                {
                    Title = "Infernal Affairs",
                    Description = "A story between a mole in the police department and an undercover cop. Their objectives are the same: to find out who is the mole, and who is the cop.",
                    Genres = new string[] { "Crime", "Mystery", "Thriller" },
                    Actors = new string[] { "Andy Lau", "Tony Leung Chiu Wai", "Anthony Wong Chau-Sang" },
                },
                new Movie("shaolin")
                {
                    Title = "Shaolin",
                    Description = "China is plunged into strife as feuding warlords try to expand their power by warring over neighboring lands.",
                    Genres = new string[] { "Action", "Drama" },
                    Actors = new string[] { "Andy Lau", "Nicholas Tse", "Bingbing Fan" },
                },
            };

            var actors = new Actor[]
            {
                new Actor("andy-lau")
                {
                    Name = "Andy Lau",
                    BirthName = "Lau Fok Wing",
                    BirthDate = new DateTime(1961, 9, 27),
                    BirthPlace = "Tai Po, Hong Kong",
                },
            };

            using (var cloudSearch = CreateClient())
            {
                cloudSearch.Upload(movies.Cast<SearchDocument>().Concat(actors));
            }
        }
Exemplo n.º 2
0
 static void OutputDocument(Movie movie)
 {
     Console.Write(movie.Id);
     Console.Write(": ");
     Console.WriteLine("{0}, {1}", movie.Title, String.Join(", ", movie.Genres));
 }