How to get one item from each category in asure cognitive search?

Chamith Karunakalage 6 Reputation points
2021-03-26T18:16:02.443+00:00

In the hotel example given, I need to get only one hotel from each category. What are the filter parameters i need to use and how?

I want a result like below where categories are Budget, Resort and Spa, Luxury, Boutique, Suite, Extended-Stay

[
{
  "@search.score": 1,
  "HotelId": "24",
  "HotelName": "Gacc Capital",
  **"Category": "Budget",**
  "Rating": 3.5
},
{
  "@search.score": 1,
  "HotelId": "22",
  "HotelName": "Stone Lion Inn",
  **"Category": "Luxury",**
  "Rating": 3.9
},
{
  "@search.score": 1,
  "HotelId": "11",
  "HotelName": "Regal Orb Resort & Spa",
  **"Category": "Extended-Stay",**
  "Rating": 2.5
},
{
  "@search.score": 1,
  "HotelId": "13",
  "HotelName": "Historic Lion Resort",
  **"Category": "Boutique",**
  "Rating": 4.1
},
{
  "@search.score": 1,
  "HotelId": "29",
  "HotelName": "Thompson House",
  **"Category": "Resort and Spa",**
  "Rating": 2.6
},
{
  "@search.score": 1,
  "HotelId": "36",
  "HotelName": "Pelham Hotel",
  **"Category": "Suite",**
  "Rating": 3.5
}
}
Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
728 questions
{count} vote