. How I can incoperate case sensitive search in AEM 6.2 with predicates.
I have tried below mentioned code unfortunately it doesn't work for me.But it is working fine in 5.6.1
Predicate authorNamePredicate = new Predicate("@authorName", "property");
.set("property", "@fn:lower-case(@" + JcrConstants.JCR_CONTENT + "/" + "authorName" + ")");
authorNamePredicate.set("value", "%" + author.toLowerCase() + "%");
@fn:lower-case(" - is converted to fn:lower-case_x0028_ this is creating issue in AEM 6.2
"/jcr:root/content/geo//*[@jcr:primaryType = 'cq:Page' and not(jcr:content/@hideInNav) and jcr:content/@jcr:title != 'Master Article' and jcr:like(fn:lower-case_x0028_/jcr:content/@authorName_x0029_, 'soumik dey')]/rep:excerpt(.) order by jcr:content/@cq:lastModified descending" This is the query it generating
Please have a look at this forum thread:-
// we never officially supported functions. Hence not a bug. You have to file enhancement request to support xpath function. it is a known problem with the OAK repository
Please create a day care ticket for this.
Reference post telling about toupper/toLower in AEM :- http://www.wemblog.com/2013/04/how-to-create-custom-query-predicate-in.html
// You need to create a create custom query predicate.
I hope this would help you.
Thank you kautuk , I have tried custom predicate in this case it throwing same error like "java.text.ParseException: Query". Am using fn:lowercase with predicates not in query. I have raised to Adobe team internally and they created Day care ticket for that. Can you confirm xpath queries are not supported in AEM 6.2 ? It will helpful for us . Our search concept working with predicates, so we need to change entire search code if it not supported.
Is this issue solved? I am also facing the same issue, let me know creating the day care tickets helped?
Workaround: converted the query to SQL2 version in our code, this would work
Please create day care ticket!!
This is not the exact code which you would need but should help you to proceed.
Thanks Kautuk, will raise a ticket and see if we can convert our search module to use sql2.
Thanks edubey, appreciate your support. The problem that I have to use this approach is that our query is slightly complexed with multiple properties queried. It looks like below, With your code approach, I cant just use
* caseinsensitive.value= queryString %.
Any idea how we can tackle this?
Thanks you ,
It is working .i have already implemented in my project and i forgot to mentioned here ..
I am facing similar issue in my Code. Could you please explain how you resolved it?