在Azure搜索查询中转义单引号

Arr*_*ron 1 api search filter azure-cognitive-search

我在过滤条件下的数据中有一个单引号。

例如:David O'Neil。

因此,如果我们在Search Explorer中将此设置为

*&$ count = true&$ filter =名称eq'David O'Neil'

我们如何在过滤器中转义该单引号。

更新1:如果我们使用单引号将其转义,则0条记录即将到来。

更新2:也不能使用反斜杠()。

Bru*_*ton 7

OData过滤器中的单引号通过加倍转义:

$filter=Name eq 'David O''Neil'
Run Code Online (Sandbox Code Playgroud)

由于那为您带来了零记录,因此我想您的数据还有其他问题(也许O'Neil中的撇号不是ASCII字符39,而是更华丽的东西?)