This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.19k
stars
4.55k
forks
source link
[BUG] Azure Search Service fails when sorting a field in descending order #44858
When attempting to execute a query that added story_publish_date desc to SearchOptions.OrderBy it generated an invalid odata expression.
Exception details:
Invalid expression: Syntax error: character '+' is not valid at position 18 in 'story_publish_date+desc'.
Parameter name: $orderby
Status: 400 (Bad Request)
Content:
{"error":{"code":"","message":"Invalid expression: Syntax error: character '+' is not valid at position 18 in 'story_publish_date+desc'.\r\nParameter name: $orderby"}}
Library name and version
Azure.Search.Documents 11.5.1
Describe the bug
When attempting to execute a query that added
story_publish_date desc
toSearchOptions.OrderBy
it generated an invalid odata expression.Exception details: Invalid expression: Syntax error: character '+' is not valid at position 18 in 'story_publish_date+desc'. Parameter name: $orderby Status: 400 (Bad Request)
Content:
Stack Trace:
Expected behavior
Search result to be sorted.
Actual behavior
Exception is thrown when sort parameter is included.
Reproduction Steps
Environment
No response