【发布时间】:2020-09-06 20:45:50
【问题描述】:
目前,我们正在使用 Azure Cosmos Db,但考虑使用 Azure 搜索,因为它能够处理模糊搜索、拼写错误、同义词映射等。但由于 Azure 搜索将成为我们的主要搜索,我们最终将索引嵌套集合也是。
我们当前的架构如下:
{
"id": "0010010011001",
"partitionKey": "001001001",
...
...
"items": [
{
"id": 1,
"name": "abc",
“category”: “A”,
“subItems”: [
{
"id": 1,
"level": "1",
“rank”: “1”,
“description”: “abc”
},
{
"id": 2,
"level": "1",
“rank”: “2”,
“description”: “def”
},
{
"id": 3,
"level": "2",
“rank”: “3”,
“description”: “xyz”
}
]
},
{
"id": 2,
"name": "def",
“category”: “A” ,
“subItems”: [
….
]
},
{
"id": 3,
"name": "xyz",
“category”: “B” ,
“subItems”: [
….
]
}
]
}
我们的要求是我们将拥有三个过滤器,名称(模糊搜索)、类别和排名。而且我们必须只从文件中选择名称/类别匹配的那些项目,而且我们还必须只选择项目中排名匹配的那些子项目。在查询 Cosmos 时,我正在对项和子项进行连接查询,但不确定如何在此处查询和选择元素。
【问题讨论】:
标签: azure-cosmosdb azure-cognitive-search