Query Builder AEM 6.5: does not contain predicate | Community
Skip to main content
Level 4
September 23, 2022
Solved

Query Builder AEM 6.5: does not contain predicate

  • September 23, 2022
  • 1 reply
  • 1724 views

Hi everyone, so when I need to add a query for contains I use like operation as shown below:

 

```

type=nt:unstructured
path=/content/dam/en/articles
nodename=master
orderby=@title
p.limit=0
p.skip=0
p.hits=selective
p.properties=jcr:path
property=primaryCategoryTag
property.value=%rally%
property.operation=like

```

 

However I have a use case where I need to do contains not, can someone help me to do the same? Is there any operation as `unlike`? Which helps me pick all those entities which doesn't contain the given text?

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

I think this is not possible with QueryBuilder , you can create your own predicate e.g.

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/CaseInsensitiveLikePredicate.java 

 

or use SQL2

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
September 23, 2022

I think this is not possible with QueryBuilder , you can create your own predicate e.g.

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/CaseInsensitiveLikePredicate.java 

 

or use SQL2

Arun Patidar
Level 4
September 26, 2022

If lets say I want to deploy these to AEM cloud locally, where am I supposed to add these files? Predicates that I create?

arunpatidar
Community Advisor
Community Advisor
September 26, 2022

This is a java code, you have to deploy via code module.

Arun Patidar