AI-102 exam dumps

AI-102 practice question 380 of 493

Designing and Implementing a Microsoft Azure AI Solution. Professional level, Microsoft. Free question with the correct answer and a full explanation.

AI-102 Question 380

Single answer

You are developing an Azure Cognitive Search solution for an e-commerce platform. The platform allows users to search for products using various filters, such as price range, product category, and keywords. You need to create a query to retrieve all products in the 'Electronics' category with a price less than $500, sorted by price in ascending order. Which of the following queries achieves this?

  1. A

    search=*&$filter=category eq 'Electronics' and price lt 500&$orderby=price asc

  2. B

    search=*&$filter=category eq 'Electronics' and price gt 500&$orderby=price desc

  3. C

    search=*&$filter=category eq 'Electronics' and price lt 500&$orderby=price desc

  4. D

    search=*&$filter=category eq 'Electronics'&$orderby=price asc

Show answer and explanation

Correct answer: A

Explanation

The correct query must include the appropriate filter for the 'Electronics' category and a price less than $500, as well as sort the results by price in ascending order. Only the first option meets all these criteria.

  • A. Correct.

    This query correctly applies the filter for the 'Electronics' category and price less than $500, and sorts the results by price in ascending order. This fulfills all the requirements in the scenario.

  • B. Incorrect.

    This query filters for the 'Electronics' category but uses a filter for price greater than $500 and sorts in descending order, which does not meet the conditions specified.

  • C. Incorrect.

    This query filters for the 'Electronics' category and price less than $500 but sorts in descending order instead of ascending order, which does not meet the sorting requirement.

  • D. Incorrect.

    This query filters for the 'Electronics' category but does not filter for price less than $500. It sorts by price in ascending order, but it does not fully meet the requirements.

Timed practice exam

Take a AI-102 practice test under exam conditions

40 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam