Use ranking to display entity search results
Each entity search response includes a RankingResponse answer that tells you how to display the search results. For details about using the ranking response, see Web Search API.
Ranking response examples
The following shows an example RankingResponse object for entities.
{
"_type": "SearchResponse",
"queryContext": {
"originalQuery": "Jimi Hendrix"
},
"entities": { ... },
"rankingResponse": {
"sidebar": {
"items": [
{
"answerType": "Entities",
"resultIndex": 0,
"value": {
"id": "https://www.bingapis.com/api/v7/#Entities.0"
}
},
{
"answerType": "Entities",
"resultIndex": 1,
"value": {
"id": "https://www.bingapis.com/api/v7/#Entities.1"
}
}
]
}
}
}
Based on this ranking response, you'd display both entities in the sidebar.
And this example shows what the ranking response looks like for local business entities.
{
"_type": "SearchResponse",
"queryContext": {
"originalQuery": "hilton near me",
"askUserForLocation": true
},
"places": { ... },
"rankingResponse": {
"mainline": {
"items": [
{
"answerType": "Places"
},
{
"answerType": "Places",
"resultIndex": 0,
"value": {
"id": "https://www.bingapis.com/api/v7/#Places.0"
}
},
{
"answerType": "Places",
"resultIndex": 1,
"value": {
"id": "https://www.bingapis.com/api/v7/#Places.1"
}
},
{
"answerType": "Places",
"resultIndex": 2,
"value": {
"id": "https://www.bingapis.com/api/v7/#Places.2"
}
},
{
"answerType": "Places",
"resultIndex": 3,
"value": {
"id": "https://www.bingapis.com/api/v7/#Places.3"
}
},
{
"answerType": "Places",
"resultIndex": 4,
"value": {
"id": "https://www.bingapis.com/api/v7/#Places.4"
}
}
]
}
}
}
Next steps
- Learn about sending entity search requests
- Learn about the quickstarts and samples that are available to help you get up and running fast.
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin