AEM 6.3 Query builder - How to search for case insensitive ? | Community
Skip to main content
surenk
Level 4
Apr 6, 2020 11:48 PM UTC
Solved

AEM 6.3 Query builder - How to search for case insensitive ?

How can we make the query to ignore case sensitivity of the `property.value` ? 

Using `orderby.case=ignore` is not helping.  

 

Our query:

path=/content/central-content/jcr:content/main/decline_letter property.value=0091A property=@letterNumber type=nt:unstructured orderby.case=ignore

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
nidhip010816
nidhip010816Accepted solution
Employee
Apr 8, 2020 6:12 PM UTC

Hey,

 

You may do a custom implementation for this. The below doc may help - 

 

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/implementing-custom-predicate-evaluator.html

 

This one is not Adobe Doc but seems it will match your use case -> http://experience-aem.blogspot.com/2015/05/aem-6-sp2-query-builder-predicate-evaluator-ignore-case.html

 

Warm Regards,

Nidz

5 replies

nidhip010816
nidhip010816Accepted solution
Employee
Apr 8, 2020 6:12 PM UTC

Hey,

 

You may do a custom implementation for this. The below doc may help - 

 

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/implementing-custom-predicate-evaluator.html

 

This one is not Adobe Doc but seems it will match your use case -> http://experience-aem.blogspot.com/2015/05/aem-6-sp2-query-builder-predicate-evaluator-ignore-case.html

 

Warm Regards,

Nidz

Translate
surenk
surenkAuthor
Level 4
May 8, 2020 2:03 PM UTC
Yes if there's lots of joins/rules to be applied, but unfortunately not all customers/dev-teams agree to custom code for trivial things.
Translate
surenk
surenkAuthor
Level 4
Apr 7, 2020 2:45 PM UTC

Using `fulltext` seemed to be helping/working.

path=/content/central-content/jcr:content/main/decline_letter fulltext=0091A property=@letterNumber type=nt:unstructured orderby.case=ignore

 

fulltext may not be a good solution is we have to be searching among a lot of nodes/data. In our case, we search for a very minimal number of nodes.

Translate
Employee
Apr 7, 2020 1:18 PM UTC

Lucene is case sensitive.

 

You'd need to run the token through the LowerCaseFilter

 

Do you have a custom index for your queries? 

 

To accomplish this you'll need to modify an index definition in CRX/DE.

 

I'm going to assume you're using a custom index  

 

1) under  /oak:index/your-custom-index

2) add an analyzers nt:unstructured node

3) add a default nt:unstructured node under analyzers 

3) add a filters nt:unstructured node under default

4) add a LowerCase nt:unstructured node under filters

5) reindex the index.

 

Translate
surenk
surenkAuthor
Level 4
Apr 7, 2020 2:10 PM UTC
Thanks for the suggestions. We are not using any index. This is a simple use-case. There will be about 10-20 nodes of content, service needs to return the content if the letter is found.
Translate