Dear Team,
. 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");
authorNamePredicate.set(JcrPropertyPredicateEvaluator.OPERATION, JcrPropertyPredicateEvaluator.OP_LIKE);
authorNamePredicate
.set("property", "@fn:lower-case(@" + JcrConstants.JCR_CONTENT + "/" + "authorName" + ")");
authorNamePredicate.set("value", "%" + author.toLowerCase() + "%");
authorgroup.add(authorNamePredicate);
@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
Thanks!
Unnikrishnan
Hi
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.
~kautuk
Views
Replies
Total Likes
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.
Thanks!,
Unnikrishnan
Views
Replies
Total Likes
Hi Kirshnan,
Is this issue solved? I am also facing the same issue, let me know creating the day care tickets helped?
Thanks,
Ravi
Views
Replies
Total Likes
Workaround: converted the query to SQL2 version in our code, this would work
Please create day care ticket!!
-Kautuk
Views
Replies
Total Likes
Thanks Kautuk, will raise a ticket and see if we can convert our search module to use sql2.
This is not the exact code which you would need but should help you to proceed.
Views
Replies
Total Likes
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.property=jcr:content/@jcr:title
* caseinsensitive.value= queryString %.
Any idea how we can tackle this?
fulltext=tax
mainasset=true
1_group.1_group.path=/content/project_name
2_group.1_group.type=cq:Page
2_group.1_group.p.or=true
1_group.2_group.path=/content/dam/project_name
1_group.p.or=true
2_group.2_group.type=dam:Asset
2_group.p.or=true
2_group.2_group.1_property=jcr:content/metadata/dc:format
2_group.2_group.1_property.1_value=application/pdf
2_group.2_group.5_group.2_property.operation=like
2_group.2_group.5_group.2_property=jcr:content/metadata/dc:description
2_group.2_group.5_group.2_property.1_value=%tax%
2_group.2_group.5_group.3_property.operation=like
2_group.2_group.5_group.3_property=jcr:content/metadata/cq:tags
2_group.2_group.5_group.3_property.1_value=%tax%
2_group.2_group.5_group.4_property.operation=like
2_group.2_group.5_group.4_property=jcr:content/metadata/dc:title
2_group.2_group.5_group.4_property.1_value=%tax%
2_group.2_group.5_group.p.or=true
3_group.p.and=true
3_group.property=jcr:content/hideInSearch
3_group.property.operation=not
5_group.1_relativedaterange.property=jcr:content/cq:lastModified
5_group.1_relativedaterange.upperBound=0
2_group.1_group.2_property=jcr:content/contentType
2_group.1_group.2_property.1_value=Article
2_group.1_group.1_property=jcr:content/cq:tags
2_group.1_group.1_property.1_value=%tax%
2_group.1_group.1_property.operation=like
Views
Replies
Total Likes
Thanks you ,
It is working .i have already implemented in my project and i forgot to mentioned here ..
Views
Replies
Total Likes
Hi Devakrishna
I am facing similar issue in my Code. Could you please explain how you resolved it?
Views
Replies
Total Likes
@Unnikrishnankv , Can you please mention how you got this issue resolved?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies