Which two objects should you use?

Posted by: Pdfprep Category: AZ-203 Tags: , ,

You are developing a project management service by using ASP.NET. The service hosts conservations, files, to-do lists, and a calendar that users can interact with at any time.

The application uses Azure Search for allowing users to search for keywords in the project data.

You need to implement code that creates the object which is used to create indexes in the Azure Search service.

Which two objects should you use? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
A . SearchCredentials
B . SearchIndexClient
C . SearchServiceClient
D . SearchService

Answer: BC

Explanation:

The various client libraries define classes like Index, Field, and Document, as well as operations like Indexes.Create and Documents.Search on the SearchServiceClient and SearchIndexClient classes.

Example:

The sample application we’ll be exploring creates a new index named "hotels", populates it with a few documents, then executes some search queries. Here is the main program, showing the overall flow:

/ This sample shows how to delete, create, upload documents and query an index

static void Main(string[] args)

{

IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile("appsettings.json");

IConfigurationRoot configuration = builder.Build();

SearchServiceClient serviceClient = CreateSearchServiceClient(configuration);

Console.WriteLine("{0}", "Deleting index…n");

DeleteHotelsIndexIfExists(serviceClient);

Console.WriteLine("{0}", "Creating index…n");

CreateHotelsIndex(serviceClient);

ISearchIndexClient indexClient = serviceClient.Indexes.GetClient("hotels");

References: https://docs.microsoft.com/en-us/azure/search/search-howto-dotnet-sdk

Leave a Reply

Your email address will not be published.