Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Query issues after migrating from CQ 5.5 to AEM 6.1

Avatar

Level 3

I am testing a site that I recently migrated from CQ 5.5 to AEM 6.1 and I found issues with one of our existing queries. The query in question is:

path=/content/history/research/histories property=@../jcr:content/cq:template property.value=/apps/history/templates/redirectpage orderby=@fn:lower-case(jcr:content/jcr:title) orderby.sort=asc p.limit=-1

I've discovered that there are a couple of different problems with the query - first that the 'property=@../jcr:content/cq:template' no longer returns results; and second that I'm seeing the following exception reported on the 'orderby':

21.01.2016 11:55:04.893 *ERROR* [0:0:0:0:0:0:0:1 [1453395304889] GET /libs/cq/search/content/querydebug.html HTTP/1.1] com.day.cq.search.impl.builder.QueryBuilderImpl Unable to get PredicateEvaluator instance: fn:lower-case(@jcr:content/jcr:title) org.osgi.framework.InvalidSyntaxException: Unknown operator: : (component.factory=com.day.cq.search.eval.PredicateEvaluator/fn:lower-case(@jcr:content/jcr:title))

 

 

I was able to easily work around the first issue by modifying the criteria for the query but the error with 'fn:lower-case' is a problem. Is this function no longer supported in AEM 6.1? Or did I miss something in the migration? Any help would be greatly appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 10
  1. Hi Randy,
  2. I made a small change with the path for the orderby and it worked for me.. Basically you have to check for the jcr:title at the same level where your property is also checked.

        I was able to get the results with this change and see if it works for you aswell

 

 

  1. path=/content/history/research/histories
  2. property=@../jcr:content/cq:template
  3. property.value=/apps/history/templates/redirectpage
  4. orderby=@fn:lower-case(../jcr:content/jcr:title)
  5. orderby.sort=asc
  6. p.limit=-1

View solution in original post

9 Replies

Avatar

Correct answer by
Level 10
  1. Hi Randy,
  2. I made a small change with the path for the orderby and it worked for me.. Basically you have to check for the jcr:title at the same level where your property is also checked.

        I was able to get the results with this change and see if it works for you aswell

 

 

  1. path=/content/history/research/histories
  2. property=@../jcr:content/cq:template
  3. property.value=/apps/history/templates/redirectpage
  4. orderby=@fn:lower-case(../jcr:content/jcr:title)
  5. orderby.sort=asc
  6. p.limit=-1

Avatar

Level 3

Thanks for your response. I tried the change in the orderby clause and it did not generate the error, but did not actually order the results at all so I'm not sure what's going on there. If I remove the @fn:lower-case then the results are ordered but the ordering is case sensitive. For some reason the lower-case function is not working at this point.

Avatar

Employee Advisor

We did see the same exception when we upgraded to 6.1 instance with lower case function.  We raised a support ticket with day care and it was acknowledged as a bug by the support team. As a workaround we had to use the SQL2 version of the query in our code on 6.1. 

Avatar

Level 3

We are facing this same issues in both AEM 6.2  and 6.2+SP1 . 

Any quick fixes as move to sql2 ,  will incur lots of codes changes. 

Can you help me to  fix this.

 

Thanks!, 

Unnikrishnan

Avatar

Level 2

I am facing the same issue.

Here is query details:

querybuilder.PNG

And it throws following exception:

""20.07.2017 16:15:23.699 *ERROR* [10.0.2.2 [1500531323686] GET /libs/cq/search/content/querydebug.html HTTP/1.1] com.day.cq.search.impl.builder.QueryBuilderImpl Unable to get PredicateEvaluator instance: jcr:created""

It happened when I upgraded to AEM 6.1 SP2.

Any solution?

Regards,

Thanh

Avatar

Level 2

I did try to create some customize oak:index for field "jcr:created", such as "ordered", "property", "lucene" but not working.

Avatar

Level 2

Error fixed. I just updated from "orderby=jcr:created" to "orderby=@jcr:created". I am not sure why it was working before the upgraded AEM 6.1 SP2.

Regards.

Avatar

Level 2

Hi,

Sorry my mistake, it is not because the SP2. Actually, It was happening before the upgrading but only the log level is different after the upgrade.

Before upgrade (only *WARN* throws in log):

*WARN* [10.43.32.6 [1500385837727] HEAD /content/.../.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl no PredicateEvaluator found for 'jcr:created'

After upgrade (WARN and ERROR throws in log):

*WARN* [10.43.32.6 [1500385837727] HEAD /content/.../.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl no PredicateEvaluator found for 'jcr:created'

*ERROR* [10.0.2.2 [1500529775451] GET /libs/cq/search/content/querydebug.html HTTP/1.1] com.day.cq.search.impl.builder.QueryBuilderImpl Unable to get PredicateEvaluator instance: jcr:created