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://learn.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.

David W Gray
  • 681
  • 6
  • 18
  • There is no such method for .net SDK , may I know more about your requirement ? Maybe there will be some workaround – Md Farid Uddin Kiron Jul 30 '19 at 08:17
  • @MdFaridUddinKiron - Thanks for your response. I added my use case to the question. In addition, this is definitely a regression from previous versions as I made heavy use of this capability while moving my infrastructure over from AzureSql to Azure Search. – David W Gray Jul 31 '19 at 14:46

1 Answers1

1

If you would like this behavior back, please create a github issue: https://github.com/Azure/azure-sdk-for-net/issues

For now you can implement it by yourself using the old code as guide: https://github.com/Azure/azure-sdk-for-net/blob/e63db195f2f2213984d4bdf81e7c495527b6217d/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchParameters.cs#L157

Jacob Jedryszek
  • 6,365
  • 10
  • 34
  • 39