Created
May 21, 2014 13:15
-
-
Save helms-charity/64a57309b96566697347 to your computer and use it in GitHub Desktop.
X-path in query builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> I'm interested in finding a list of child pages of a node with a specific tag e.g. | |
> | |
> type=cq:Page | |
> path=/content/geometrixx/en/toolbar | |
> p.hits=full | |
> property=jcr:content/cq:tags | |
> property.operation=equals | |
> property.value=geometrixx-media:events/concerts | |
> | |
> However, the query does a deep search and returns a list of all the pages whose path starts with the aforesaid value. I do not want to do deep search. I'm interested in the immediate child nodes only. | |
Set path.flat=true [1]. | |
Also, instead of the "property" you might want to use the tagid predicate, which actually checks for the presence of the tag & resolves it's alternative versions (in case it has been moved): | |
tagid=geometrixx-media:events/concerts | |
tagid.property=jcr:content/cq:tags | |
[1] https://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/search/eval/PathPredicateEvaluator.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment