question

ChamithKarunakalage-7313 avatar image
0 Votes"
ChamithKarunakalage-7313 asked brtrach-MSFT commented

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

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-cognitive-search
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

We have sent a private message to the customer to assist them further. We still encourage the community to participate and offer ideas and suggestions.

0 Votes 0 ·

0 Answers