I am writing an API that is basically a front end for Azure Cognitive Search.
I would like to accept an OData query ($filter, $orderby etc etc) and somehow parse this query string into a SearchParameters
object that I can call the back end with.
I realise I can do this myself, but I'm surprised there isn't such a helper function already.
Correct, there is no helper method to do this currently. It hasn't been a high priority since this is only the second time we've heard this request (this was the other time).
You can contribute to the SDK if you want. Note that there is a new .NET SDK now generally available -- Azure.Search.Documents. We are no longer maintaining or releasing Microsoft.Azure.Search, so if you do contribute, make sure it's to the right project. Also note that all Azure SDKs now must follow the Azure API Guidelines, and PRs will be handled accordingly.
One piece of advice -- Depending on how your users construct queries, you might not want to accept $filter on the URL query string. Some of our customers constructed very large filters that broke various URL query string limits, which is why we introduced the POST versions of the Search and Suggest APIs. If you're forwarding OData filters to our API, you may want to do the same. That will save you the trouble of parsing URLs as an added bonus.