0

I used to be able to retrieve the search URL from Microsoft.Azure.Search.Models.SearchParameters by calling ToString() on an object of that type. This seems to have broken, now ToString() just returns the class name (default .net behavior).

Is there an alternate way to get the search URL from SearchParameters.

I'm on Azure search 9.0.1.

The behavior that I'm expecting was documented in a previous version here: https://docs.microsoft.com/en-us/previous-versions/azure/dn957315(v%3dazure.100)

The use case for this is that I have a search UI built on top of the azure search SDK - take a look here https://www.music4dance.net/song/advancedsearchform. The UI runs on top of an Asp.Net MVC infrastructure that uses Azure Search as the engine to produce results.

When diagnosing issues or looking into ways to extend this UI, I used to be able to run a search and see both the results and generate a URL (using the aforementioned ToString()). The search URL made it easy to plug back into the Search Explorer in the Azure Portal and tweak things until I get what I want before going back to code to make it generate the right query.

4

1 回答 1

1

如果您希望恢复这种行为,请创建一个 github 问题:https ://github.com/Azure/azure-sdk-for-net/issues

现在您可以使用旧代码作为指南自行实现它:https ://github.com/Azure/azure-sdk-for-net/blob/e63db195f2f2213984d4bdf81e7c495527b6217d/src/SDKs/Search/DataPlane/Microsoft.Azure.Search .Data/Customizations/Documents/Models/SearchParameters.cs#L157

于 2019-08-06T18:29:05.493 回答