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?

chhgupta
Adobe Employee
chhguptaAdobe EmployeeAccepted solution
Adobe Employee
March 8, 2022

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