AI-102 Question 359
Select 3You are building a search solution using Azure Cognitive Search for an e-commerce platform. The platform has a catalog of products with fields such as 'ProductName', 'Category', 'Price', 'Description', and 'StockAvailability'. You need to configure an index to support the following requirements:
- Users should be able to search by product name and description.
- Filters on 'Category' and 'Price' must be supported.
- Sorting by 'Price' must be enabled.
- The 'StockAvailability' field should only be used for display purposes and not for filtering or searching.
How should you configure the index fields?
- A
Set 'ProductName' and 'Description' fields as searchable.
- B
Set 'Category' and 'Price' fields as filterable and sortable.
- C
Set 'Price' field as searchable, filterable, and sortable.
- D
Set 'StockAvailability' field as retrievable only.
- E
Set all fields as searchable to maximize search capabilities.
Show answer and explanation
Correct answers: A, B, D
Explanation
To configure the index correctly, you must align the field attributes with the specific requirements. 'ProductName' and 'Description' need to be searchable for search functionality. 'Category' and 'Price' need to be filterable to support filtering, and 'Price' also needs to be sortable. The 'StockAvailability' field should only be retrievable for display. Making all fields searchable is not recommended as it can lead to inefficiencies and irrelevant search results.
- A. Correct.
Correct: The 'ProductName' and 'Description' fields need to be searchable to allow users to search for products based on these fields.
- B. Correct.
Correct: The 'Category' and 'Price' fields need to be filterable to enable filtering functionality, and 'Price' must also be sortable to support sorting.
- C. Incorrect.
Incorrect: While 'Price' must be filterable and sortable, making it searchable is unnecessary and could lead to irrelevant search results.
- D. Correct.
Correct: The 'StockAvailability' field should be retrievable only, as it is only used for display purposes and not for filtering or searching.
- E. Incorrect.
Incorrect: Setting all fields as searchable would unnecessarily increase index size and may lead to irrelevant search results.