SQl2 query with contains does not find any nodes

Avatar

Avatar

Magicr

Avatar

Magicr

Magicr

22-09-2020

Hello,

I'm facing following strange situation and I have no idea about this behavior, using AEM6.4. Given is following situation:

 

In my project exists some nodes they have in property 'sling:resourceType' the value "c109_video". So I created two queries to find those nodes.

Query one: 

SELECT * FROM [nt:base] AS n WHERE ISDESCENDANTNODE(n, [/content/sites]) AND n.[sling:resourceType] like 'c109_video' ORDER BY n.[jcr:created] ASC

The result list contains more than zero hits. 

 

Query two: 

SELECT * FROM [nt:base] AS n WHERE ISDESCENDANTNODE(n, [/content/sites]) AND CONTAINS(n.[sling:resourceType], 'c109_video') ORDER BY n.[jcr:created] ASC

 The result list is empty.

 

Which reasons are responsible for this difference?

View Entire Topic

Avatar

Avatar

aemmarc

Employee

Avatar

aemmarc

Employee

aemmarc
Employee

22-09-2020

CONTAINS and LIKE do two different things.