How to retrieve all properties of an asset using the QueryBuilder Api
When i use the below query on http://localhost:4502/libs/cq/search/content/querydebug.html
path=/content/dam/we-retail
type=dam:Asset
p.limit=-1
p.nodedepth=2
p.hits=full
p.guesstotal=true
the formed URL/JSON querybuilder link is : http://localhost:4502/bin/querybuilder.json?p.guesstotal=true&p.hits=full&p.limit=-1&p.nodedepth=2&path=%2fcontent%2fdam…
I can see all the properties for each asset including jcr:content, metadata as below:

I need to return the same result to service/endpoint i'm building on AEM for a customer. When I translate the same above query into Query builder API
queryParamsMap.put("type", "dam:Asset");
queryParamsMap.put("p.limit", "-1");
queryParamsMap.put("p.nodedepth", "2");
queryParamsMap.put("p.hits", "full");
queryParamsMap.put("p.guessTotal", "true");
How can i retrieve all the values?
SearchResult result = query.getResult();
for (final Hit hit : result.getHits()) {
Resource resource = hit.getResource();
Asset asset = resource.adaptTo(Asset.class);
If i use asset.getMetadata() , we can see only the properties under "jcr:content/metadata" but not the other properties.
and
if i use ValueMap properties = resource.getValueMap(); we can retrieve all the asset properties (like jcr:path, jcr:primaryType etc) but not "metadata".
Is there any way to get all the values for an Asset node?