Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

QueryBuilder case insensitive like operation AEM 6.4

Avatar

Avatar
Validate 1
Level 1
shubhanshus3678
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
shubhanshus3678
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
shubhanshus3678
Level 1

26-03-2019

I have  a JCR-SQL2 Query . And is being used by QueryManager to perform case insensitive search using lower() method. I want to do the same using QueryBuilder API. We are using aem 6.4 . and  fn:lower-case(jcr:content/jcr:title)   doesn't work.

SELECT * FROM[cq:Page]  WHERE ISDESCENDANTNODE(path) AND

( lower([jcr:content/jcr:title]) LIKE '%vehi%' OR lower([jcr:content/jcr:title]) LIKE '%auto%' )

UNION

SELECT * FROM[cq:Page]  WHERE ISDESCENDANTNODE(path) AND

( lower([jcr:content/jcr:description]) LIKE '%vehi%' OR lower([jcr:content/jcr:description]) LIKE '%auto%' )

UNION

SELECT * FROM[cq:Page]  WHERE ISDESCENDANTNODE(path) AND

( lower([jcr:content/cq:tags]) LIKE '%vehi%' OR lower([jcr:content/cq:tags]) LIKE '%auto%' )

ORDER BY [jcr:content/cq:lastModified] desc

Any inputs are helpful

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

01-04-2019

The query builder does not support functions now and this solution stopped working after AEM 6.2. You need to write a custom predicate for this. Check this example - Experiencing Adobe Experience Manager - Day CQ: AEM 6 SP2 - Query Builder Predicate Evaluator for or...

Answers (4)

Answers (4)

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-04-2019

Very nice community response!

Avatar

Avatar
Validate 1
Level 1
shubhanshus3678
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
shubhanshus3678
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
shubhanshus3678
Level 1

01-04-2019

Created 2 queries , one with the method suggested and one without it.

In case of using fn-lowercase, even the XPath query is not translated. However without using method query returns result.

We are using AEM 6.4.

1722931_pastedImage_1.png

1722930_pastedImage_0.png

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

27-03-2019

Avatar

Avatar
Give back 300
MVP
Gaurav-Behl
MVP

Likes

243 likes

Total Posts

1,145 posts

Correct Reply

281 solutions
Top badges earned
Give back 300
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Give back 300
MVP
Gaurav-Behl
MVP

Likes

243 likes

Total Posts

1,145 posts

Correct Reply

281 solutions
Top badges earned
Give back 300
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
Gaurav-Behl
MVP

27-03-2019

check AEM 6.2  "fn:lowercase"  is not working

As Justin mentioned here, querybuilder search on Property case insensitive , QB would not be appropriate in this case