We are working on building aem search query using REST API, Tag based conditions are include & excludeTags.
We are able to use tagId in the include tag options which includes all the children tags and backlinks in the query while we are not able use tagids for the negation, I have to use property for unequals operation.
if we compare following two property filters from the filters defined in the link.
I couldn't use 6_tagid.operation=unequals to negate it and had to go back to property which doesn't include children and backlink tags in the query and it's doing exact tag match.
Is it intentional in AEM for performance reasons? if not how can use tagid in the excludeTags?
You can exclude the pages with certain properties using the property predicate evaluator. For ex. If you want to exclude pages which have the property "donotsearch" in its jcr:content node, then you can query it using property operation as exists.
map.put("path", "/content/geometrixx/en/toolbar"); map.put("type", "cq:Page"); /* Relative path to the property to check for */ map.put("property", "jcr:content/donotsearch"); /* Operation to perform on the value of the prop, in this case existence check */ map.put("property.operation", "exists"); /* Value for the prop, false = not, by default it is true */ map.put("property.value", "false");
But in case you would like to exclude pages with certain value for the property donotsearch, then you can change the above query as shown below
map.put("property", "jcr:content/donotsearch"); //the property to check for map.put("property.operation", "equals"); // or unequals or like etc.. map.put("property.value", "/*the value of the property*/");
I have already gone through all the above, I can easily exclude the specific tag in the query but if you use tagid, it considers children tags and backlinks in the query, I couldn't exclude using tagid predicate.
if you see my two above filters I have already used unequals operations with property which does exact mismatch of the tag specified, I want to have that tag plus it's children and backlinks in my query exclude operation, I am able to do it in include tags using tagid predicate.(see above 2_ filter)