QueryBuilder API: How to query like operations in case insensetive manner? | Community
Skip to main content
September 21, 2022
Solved

QueryBuilder API: How to query like operations in case insensetive manner?

  • September 21, 2022
  • 1 reply
  • 1210 views

I have a query like this:

type=nt:unstructured
path=/content/dam/articles
nodename=master
group.p.or=true
group.1_property=title
group.1_property.value=%article
group.1_property.operation=like

...

for group's `1_property` I want to search without case senstivity, how can I achieve the same? I am on AEM 6.5

 

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 Priyanku_Dwivedi

You may need to write a custom Predicate to achieve it. please refer to following example - https://blogs.perficient.com/2020/11/11/case-insensitive-queries-with-the-aem-query-builder/

 

For like operation xpath would be something like this - 

/jcr:root/content/dam/wknd/en//*[(jcr:like(fn:lower-case(@property),'value%'))]

Make changes to example code accordingly.   

1 reply

Priyanku_DwivediAdobe EmployeeAccepted solution
Adobe Employee
October 12, 2022

You may need to write a custom Predicate to achieve it. please refer to following example - https://blogs.perficient.com/2020/11/11/case-insensitive-queries-with-the-aem-query-builder/

 

For like operation xpath would be something like this - 

/jcr:root/content/dam/wknd/en//*[(jcr:like(fn:lower-case(@property),'value%'))]

Make changes to example code accordingly.