gpt4 book ai didi

azure - 使用 VScode Azure 认知服务扩展一次在索引中插入多个文档。 (Azure 搜索服务)

转载 作者:行者123 更新时间:2023-12-02 23:58:41 26 4
gpt4 key购买 nike

我想一次将多个文档插入Azure 搜索服务中的索引。我正在使用 VScode 扩展 Azure 认知服务 进行插入,如其文档中所述。

官方文档链接: https://learn.microsoft.com/en-us/azure/search/search-get-started-vs-code

官方文档提到了插入单个JSON的方法,即右键文档->创建新文档

我尝试使用上述方法插入多个以逗号分隔的 JSON 文档(下面附有片段),我得到了预期的错误:

Unexpected token, in JSON at position 915

我尝试在单个创建新文档中插入多个文档:

{
"HotelId": "4",
"HotelName": "Sublime Cliff Hotel",
"Description": "Sublime Cliff Hotel is located in the heart of the historic center of Sublime in an extremely vibrant and lively area within short walking distance to the sites and landmarks of the city and is surrounded by the extraordinary beauty of churches, buildings, shops and monuments. Sublime Cliff is part of a lovingly restored 1800 palace.",
"Description_fr": null,
"Category": "Boutique",
"Tags": [
"concierge",
"view",
"24-hour front desk service"
],
"ParkingIncluded": true,
"LastRenovationDate": "1960-02-06T00:00:00Z",
"Rating": 4.6,
"Address": {
"StreetAddress": "7400 San Pedro Ave",
"City": "San Antonio",
"StateProvince": "TX",
"PostalCode": "78216",
"Country": "USA"
}
},
{
"HotelId": "5",
"HotelName": "Sublime Cliff Hotel",
"Description": "Sublime Cliff Hotel is located in the heart of the historic center of Sublime in an extremely vibrant and lively area within short walking distance to the sites and landmarks of the city and is surrounded by the extraordinary beauty of churches, buildings, shops and monuments. Sublime Cliff is part of a lovingly restored 1800 palace.",
"Description_fr": null,
"Category": "Boutique",
"Tags": [
"concierge",
"view",
"24-hour front desk service"
],
"ParkingIncluded": true,
"LastRenovationDate": "1960-02-06T00:00:00Z",
"Rating": 4.6,
"Address": {
"StreetAddress": "7400 San Pedro Ave",
"City": "San Antonio",
"StateProvince": "TX",
"PostalCode": "78216",
"Country": "USA"
}
}

有谁知道使用 VScode 在索引中一次插入多个文档的方法吗?

最佳答案

您可以使用 Postman 执行相同的操作,方法是使用正文中传递的 JSON 创建 POST 请求。这适用于将单个文档以及多个文档输入索引

官方文档链接- https://learn.microsoft.com/en-us/azure/search/search-get-started-rest

关于azure - 使用 VScode Azure 认知服务扩展一次在索引中插入多个文档。 (Azure 搜索服务),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68006398/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com