Exemplo n.º 1
0
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            await searchIndex.CreateIndexAsync();

            var testItem = new SearchItem
            {
                Id     = "1234",
                Url    = "https://www.google.com",
                Title  = "This is a test item",
                Precis = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Illum hic aut, ex voluptatibus quidem autem, ipsam expedita tempora nisi possimus nam laboriosam in voluptates consectetur eligendi reprehenderit quibusdam velit aspernatur.",
                Body   = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Illum hic aut, ex voluptatibus quidem autem, ipsam expedita tempora nisi possimus nam laboriosam in voluptates consectetur eligendi reprehenderit quibusdam velit aspernatur."
            };

            await searchIndex.IndexAsync(testItem);

            testItem = new SearchItem
            {
                Id     = "4321",
                Url    = "https://www.google.com",
                Title  = "Red green yellow blue",
                Precis = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Illum hic aut, ex voluptatibus quidem autem, ipsam expedita tempora nisi possimus nam laboriosam in voluptates consectetur eligendi reprehenderit quibusdam velit aspernatur.",
                Body   = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Illum hic aut, ex voluptatibus quidem autem, ipsam expedita tempora nisi possimus nam laboriosam in voluptates consectetur eligendi reprehenderit quibusdam velit aspernatur."
            };

            await searchIndex.IndexAsync(testItem);
        }