Expand my Community achievements bar.

Query Builder API: Returns only the path instead of whole details. Is it possible to get complete content ?

Avatar

Level 5

I am doing a query which looks as follows:

 

type=nt:unstructured
path=/content/dam/rallyhealth/ichabod/articles
p.hits=selective
nodename=master
p.properties=author featuredImage primaryCategory

 

The results look like:

 

```

{
  "success": true,
  "results": 2,
  "total": 2,
  "more": false,
  "offset": 0,
  "hits": [
    {
      "primaryCategory": "/content/dam/health",
      "author": "Article Author"
    },
    {
      "author": "Kamal"
    }
  ]
}

```

 

However with GQL, I get the results as:

 

```

"primaryCategory": {
"_path": "/content/dam/health",
"title": "Health",
"uri": "health-resources/health"
}

```

Is there a way to tell queryBuilder to not only return the path but also the other parameters like title and uri?

2 Replies

Avatar

Community Advisor

p.hits=full  : will give all the properties in the node.

p.hits=selective :  Use this if you want to return selective properties in search result.

 

Please check this blog. https://hashimkhan.in/2015/12/02/query-builder/ its helpful.

Avatar

Level 5

Hey Dharmraj, thanks for the response.

 

Whatever you shared I am already aware of that however my question wasnt that if you see the difference when making call with GQl vs making call with queryBuilder api, you will observe when another content fragment is referenced in one content fragment only then it returns only the path of other content fragment however I want all its content and not just path.

 

The most simple example would be image.

In case of image it returns path of image however GQl api returns whole response like publishUrl authorUrl etc