Closed Jasperav closed 4 years ago
The example you show is the way I would recommend for now.
What would be really useful here is a SearchResponse<T>
struct that the response from the search API is deserialized into. This is something that we would like to provide eventually, but it is a sizeable undertaking, more so for more complex responses like search! I'm going to close this issue in order to discuss on #75 as it is related to this issue.
When using the search api, the queried objects are in an array inside "hits" and another "hits". Furthermore, the actual objects are again nested inside a "_source" object. So to extract the data from a search, I have this code:
This looks like code that can be somewhere in this library (else everyone needs to write something like this). Is there a standard way of doing what I am doing?