I am trying to get article pages tagged with only specified cq: tags. I Followed following documentation and ACS Commons Git references.
When I execute query in predicate query console it works fine. It returns me only articles only with required tags.where as when I run query in java code. I get search results of all pages.
Please advise which I am missing.
path=/content/apples/en
type=cq:Page
property=@jcr:content/sling:resourceType
property.value=apples/components/page/article
tagid.property=jcr:content/cq:tags
tagid.1_value=namespace-a:some/tag
tagid.2_value=namespace-a:some/other/tag
orderby=@jcr:content/date
orderby.sort=desc
p.offset=0
p.limit=-1
// Tag Predicate - this has been moved into an impl package so Javadocs are not generated for it.
map.put("tagid.property", "jcr:content/cq:tags"); // Default is 'cq:tags'
map.put("tagid.1_value", "namespace-a:some/tag"); // Note the #_ prefix for values is required.
map.put("tagid.2_value", "namespace-a:some/other/tag");
Thank You
Solved! Go to Solution.
Can you try with below query
path=/content/we-retail
type=cq:Page
orderby=@jcr:score
orderby.sort=desc
1_property=jcr:content/cq:tags
1_property.1_value=we-retail:equipment
1_property.2_value=we-retail:season/summer
2_property=jcr:content/sling:resourceType
2_property.value=weretail/components/structure/page
orderby=@jcr:content/date
orderby.sort=desc
Please check Query Builder API
You may need to update your code
map.put("tagid.property", "jcr:content/@cq:tags");
NOT really. That did not work Arun Patidar
Can you try with below query
path=/content/we-retail
type=cq:Page
orderby=@jcr:score
orderby.sort=desc
1_property=jcr:content/cq:tags
1_property.1_value=we-retail:equipment
1_property.2_value=we-retail:season/summer
2_property=jcr:content/sling:resourceType
2_property.value=weretail/components/structure/page
orderby=@jcr:content/date
orderby.sort=desc
Hi,
you can try something like this
1_tagid.property=jcr:content/cq:tags
1_tagid.1_value=we-retail:equipment
1_tagid.2_value=we-retail:season/summer
Hi Arun,
Im getting all the pages with cqtag "jurassicworldfacts:featured"(since i have that tag added to pages). Now i dont have a tag called "jurassicworldfacts:test".
If i give that value in the below query im getting all the results(pages). ideally i should not get any results since i dont have that tag at all.
path=/content/mobile-apps
path.self=false
type=cq:PageContent
tagid.property=cq:tags
tagid.1_value=jurassicworldfacts:test
Am i missing something here?
Can you please help me on this?
Hi,
Try below:
path=/content/mobile-apps
path.self=false
type=cq:Page
property=jcr:content/cq:tags
property.value=jurassicworldfacts:featured
Hi @arunpatidar
What should be the query if i want to return the tag value for CF's under certain paths..
Views
Replies
Total Likes
I think you just need to change the path predicate
e.g.
path=/content/dam/my-project/content-fragment-path/xyz
Views
Replies
Total Likes
Hi @arunpatidar
path=/content/dam/my-project/content-fragment/seema
type=dam:Asset
property=jcr:content/cq:tags
Is it correct?
I want to return the value of tags associated with fragments under folder seema
Views
Replies
Total Likes
path=/content/dam/my-project/content-fragment/seema
type=dam:Asset
property=jcr:content/metadata/cq:tags
Views
Replies
Total Likes
Hi @arunpatidar
Its not giving the value of tags
Its only giving :-
excerpt:
lastModified:
name:
path:
title:
Views
Replies
Total Likes
you have to specify that, you want tags
http://localhost:4502/bin/querybuilder.json?p.hits=selective&p.limit=-1&p.properties=jcr%3apath%20jc...
path=/content/dam/we-retail/en/faqs/shipping-and-returns
type=dam:Asset
p.hits=selective
p.properties=jcr:path jcr:content/metadata/cq:tags
p.limit=-1
Views
Replies
Total Likes