exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 1 question 30 discussion

Actual exam question from Microsoft's AZ-204
Question #: 30
Topic #: 1
[All AZ-204 Questions]

DRAG DROP -
You are a developer for a company that provides a bookings management service in the tourism industry. You are implementing Azure Search for the tour agencies listed in your company's solution.
You create the index in Azure Search. You now need to use the Azure Search .NET SDK to import the relevant data into the Azure Search service.
Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions from left to right and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
1. The index needs to be populated. To do this, we will need a SearchIndexClient. There are two ways to obtain one: by constructing it, or by calling
Indexes.GetClient on the SearchServiceClient. Here we will use the first method.
2. Create the indexBatch with the documents
Something like:
var hotels = new Hotel[];
{
new Hotel()
{
HotelId = "3",
BaseRate = 129.99,
Description = "Close to town hall and the river"
}
};
ג€¦
var batch = IndexBatch.Upload(hotels);
3. The next step is to populate the newly-created index
Example:
var batch = IndexBatch.Upload(hotels);
try
{
indexClient.Documents.Index(batch);
}
Reference:
https://docs.microsoft.com/en-us/azure/search/search-howto-dotnet-sdk

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
[Removed]
Highly Voted 2 years, 4 months ago
Azure search is out of scope for AZ-204
upvoted 30 times
...
wrak
Highly Voted 2 years ago
out-of-the-scope for the AZ-204 Exam; please remove from the Question Bank
upvoted 8 times
...
aks_exam
Most Recent 4 months, 1 week ago
Azure Search has been replaced by Azure Cognitive Search. It means not that this Q is out of scope
upvoted 1 times
...
Zinat
1 year, 5 months ago
azure search is deprecated
upvoted 4 times
...
moota
1 year, 9 months ago
It's also possible the indexClient comes after creating the batch. // Assume that you have a collection of documents called "documents" List<MyDocumentType> documents = GetDocuments(); // Replace MyDocumentType with the actual type of your documents // 1. Create an IndexBatch that contains the documents which must be added. IndexBatch<MyDocumentType> batch = IndexBatch.Upload(documents); // 2. Create a SearchIndexClient object to connect to the search index. // Assume that searchIndexName is the name of your Azure Search index SearchIndexClient indexClient = serviceClient.Indexes.GetClient(searchIndexName);
upvoted 1 times
...
tom112
1 year, 9 months ago
it's SearchClient.IndexDocuments(batch) method, actually.
upvoted 1 times
...
NombreFalso
2 years ago
🤮🤮🤮 Bad question
upvoted 1 times
...
warchoon
2 years ago
Looks correct https://learn.microsoft.com/en-us/azure/search/search-howto-dotnet-sdk#create-an-index
upvoted 2 times
...
Discovery_
2 years, 3 months ago
Azure Search doesn't seem to be in the latest study guide. Best to avoid this question for less cram.
upvoted 4 times
...
coffecold
2 years, 5 months ago
Can't be true : uploading the data by putting it hardcoded in the source? Would suggest the solutions that use a datasource. After all you had to extract the data from the "company's solution"
upvoted 2 times
warchoon
2 years ago
It's a simple prototype. TDD, baby.
upvoted 1 times
...
...
sghaha
2 years, 10 months ago
https://docs.microsoft.com/en-us/azure/search/search-howto-dotnet-sdk
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago