odata v4 with c# - search.in不起作用

发布于 2025-02-04 07:05:59 字数 474 浏览 3 评论 0原文

我尝试使用$ filter参数与值通道/任何(t:search.in(t,'a,b',',','))。但是在ODATA V4中,我有此错误消息

"message": "The query specified in the URI is not valid. An unknown function with name 'search.in' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed.",

解决此问题的建议吗?

我的端点... $ filter = Channels/Any(t:search.in(t,'a,b',',',','))

我的模型属性频道是这样定义的public细绳[]?频道{get;放; }

I trying use $filter parameter with value Channels/any(t: search.in(t,'A,B', ',')). But in OData V4 i have this error message

"message": "The query specified in the URI is not valid. An unknown function with name 'search.in' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed.",

Any suggestion to resolve this?

my endpoint ...$filter=Channels/any(t: search.in(t,'A,B', ','))

my model property Channels is defined this way public string[]? Channels { get; set; }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倒带 2025-02-11 07:05:59

search.in 是由Azure AI搜索支持的操作员,并且不是ODATA规范的一部分。

对于ASP.NET Core的ODATA软件包,您需要使用odata $ filter in 操作员

Example 56: all products whose name value is ‘Milk’ or ‘Cheese’:

http://host/service/Products?$filter=Name in ('Milk', 'Cheese')

search.in is an operator supported by Azure AI Search and isn't part of the OData specification.

For ASP.NET Core's OData package, you would need to use an OData $filter expression with the in operator, e.g.:

Example 56: all products whose name value is ‘Milk’ or ‘Cheese’:

http://host/service/Products?$filter=Name in ('Milk', 'Cheese')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文