Query issues after migrating from CQ 5.5 to AEM 6.1 | Community
Skip to main content
Level 3
January 21, 2016
Solved

Query issues after migrating from CQ 5.5 to AEM 6.1

  • January 21, 2016
  • 9 replies
  • 4043 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Lokesh_Shivalingaiah
  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

9 replies

smacdonald2008
Level 10
January 21, 2016

Take a look at this older community thread that may help: 

https://forums.adobe.com/thread/1140679?tstart=0

Also - for AEM 6.1 - did you create a custom index? 

https://docs.adobe.com/docs/en/aem/6-1/deploy/platform/queries-and-indexing.html

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
January 21, 2016
  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
Level 3
January 22, 2016

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.

Kunal_Gaba_
January 22, 2016

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. 

Unnikrishnankv
Level 3
January 2, 2017

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

John_Ky
Level 2
July 20, 2017

I am facing the same issue.

Here is query details:

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

John_Ky
Level 2
July 20, 2017

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

John_Ky
Level 2
July 20, 2017

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.

John_Ky
Level 2
July 20, 2017

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