OData v4 with C#- search.in not works

175 Views Asked by At

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; }

1

There are 1 best solutions below

0
Scorpion On

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')