Query Builder API: Returns only the path instead of whole details. Is it possible to get complete content ? | Community
Skip to main content
Level 4
September 16, 2022

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

  • September 16, 2022
  • 1 reply
  • 644 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Saravanan_Dharmaraj
Community Advisor
Community Advisor
September 16, 2022

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.

Level 4
September 16, 2022

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