CRXDE Lite Xpath contains() query only returning results when property is specified | Community
Skip to main content
Level 2
March 7, 2022
Solved

CRXDE Lite Xpath contains() query only returning results when property is specified

  • March 7, 2022
  • 1 reply
  • 3579 views

I am trying to run a query against any node inside the path I specify, returning any nodes that contain any property containing the string 'foo'. To do so, I use this query suggested by CRXDE Lite:

 

/jcr:root/content/path//*[jcr:contains(., 'foo')] order by @6655266:score

 

I get no results.

 

But, if I specify a property, let's say html:

 

/jcr:root/content/path//*[jcr:contains(@html, 'foo')] order by @6655266:score

 

I get results.

 

Doesn't the '.' mean to search all properties? If so, why does it not return the results that I receive when I specify a property?

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 chhgupta

I am not sure why that would happen as my comment above was tested on a local OOTB AEM 6.5 instance and gave the expected result.

If you do not have a concern about data loss on local then try the below steps:
> Stop the local instance

> remove crx-quickstart folder

> restart instance

Then try this query

/jcr:root/content/we-retail//*[jcr:contains(., 'men')] order by @jcr:score



1 reply

chhgupta
Adobe Employee
Adobe Employee
March 8, 2022

Hi, 

 

I ran the below query, in CRXDE query tool, with property for example below, I got one result as only one node had title containing text 'foo'

/jcr:root/content/we-retail//*[jcr:contains(@jcr:title, 'foo')] order by @jcr:score


And when I ran the below query which has '.' instead of a specific property, I got all resultset containing foo in any of the node properties.

/jcr:root/content/we-retail//*[jcr:contains(., 'foo')] order by @jcr:score


mpuserAuthor
Level 2
March 8, 2022

Thank you for the reply!

 

Interesting, I just tried replicating my experiment in our development environment, and it worked perfectly, just as you've captured. But following the same steps in my local 4502 environment yielded the results I shared in my initial post. Both environments have the same package installed.

 

Any idea what might cause my local environment to behave this way?

Vijayalakshmi_S
Level 10
March 8, 2022

Hmm, I'm not seeing Query Performance--documentation for 6.4 seems to say it's in Tools > Operations, but I'm on AEM CS (I just realized I didn't mention that in my original post).

 

Does Query Performance exist on CS?


In AEMaaCS local SDK, there is no Operations console (hence no Query Diagnosis/Performance tool)

Can you confirm if your local SDK is latest as that of the DEV cloud service instance?