在 Azure 搜索的索引项中查找不在列表中的项

Find items that are NOT in an list within index items for Azure Search

我正在使用 Azure 搜索

我有下面的数据结构

[
    {
        "id": "7c064374-73ea-4d0c-c363-2801887b07cf",
        "companies": [
                {
                    "companyId": "6f8d235e-69b7-42f9-9917-79411754fef0",
                    "companyName": "Company"
                }
         ]
    }
]

如果我想查找帐户中存在 guid 的所有条目,过滤器是

$filter=companies/any(c: c/companyId eq 'value to find')

仅获取要查找的值不在公司列表中的条目的语法是什么?

$filter=companies/any(c: c/companyId ne 'value to find')

将不起作用,因为它会 return 索引中包含公司 ID 的任何条目,如果条目有 2 个公司,则该 ID 不是足以恢复条目的 ID,其中一个匹配标准和不符合的标准

保罗

https://docs.microsoft.com/en-us/azure/search/search-query-odata-collection-operators <pre>$filter=companies/<strong>all</strong>(c: c/companyId <strong>ne</strong> 'value to find')</pre>