Forum Discussion
Pedro Correa
Jun 03, 2021Brass Contributor
When to use and how to get querying proficiency
Alright, I will try to be short here but anyone let me know if more info is needed. We had this new project started 3 months ago, that was increasing the amount of data it was going inside our Elast...
DerekLegenzoff
Microsoft
Thanks for the clarification. The reason that the data is ending up null is because a decision was made that we want customers to own their data models as a best practice so the in-built data types don't necessarily serialize all fields (you'll run into a similar issue with counts on facets). To get around the issue you're running into, I would recommend mapping the data from the response into classes that you create. You can do this pretty quickly with a package like Mapster: https://github.com/MapsterMapper/Mapster
Pedro Correa
Jun 03, 2021Brass Contributor
Derek that sounds very promising, do you have any examples of that? I'm confuse because trough the sdk the only way for me to call the search is to pass a class for it to automatically deserialize the results for me. https://docs.microsoft.com/en-us/dotnet/api/overview/azure/search.documents-readme
so, i'm wondering, how do I control that field mapping conversion myself? Is it trough field mappings with annotations? like the mapster example show? (never seem mapster, seems very interesting, have only used automapper mysef).
so, i'm wondering, how do I control that field mapping conversion myself? Is it trough field mappings with annotations? like the mapster example show? (never seem mapster, seems very interesting, have only used automapper mysef).
- DerekLegenzoffJun 03, 2021MicrosoftAhh the issue you're experiencing might be different than I was thinking. I've seen this issue when users try to pass data to their front-end and then nulls appear. If you're not getting the data at all, it might be a different issue.
I would recommend submitting an issue on the GitHub repo so one of the developers of the SDK can look into it and provide guidance: https://github.com/Azure/azure-sdk-for-net- Pedro CorreaJun 03, 2021Brass ContributorWill do that, thank you Derek! Much appreciated the time!