When using both C# .NET code to send a query to Azure Search and when using the "Search Explorer" within the Resource-Manager style Azure Portal, Azure search will succeed when given the query (as input in Search Explorer):
search=foo&facet=category&$filter=category eq 'Teams'
But fail when given:
search=foo&facet=categoryDetails&$filter=categoryDetails eq 'Subcategory'
The error returned is:
{
"error": {
"code": "",
"message": "Invalid expression: The operand for a binary operator
'Equal' is not a single value. Binary operators require
both operands to be single values.\r\nParameter name:
$filter"
}
}
(Message is a single-line. It's formatted with line breaks here for easier reading.)
I even tried with another facet whose name is also a camelcase term, and the search also hit the same error.
My theory is that camelcase names cause issues with Azure Search. Has anyone else experienced this before? I'll suppose I'll experiment with all lowercase names while waiting for light to be shed on this.
The error had nothing to do with camelcase, but with the fact that those "fields" were of the type DataType.Collection(DataType.String)
(an array of strings).
I needed to search using a kind of subquery as shown in Filter and collections in OData
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With