Expand my Community achievements bar.

SOLVED

AEM6.3 - QueryBuilder - filter by properties that contains some string

Avatar

Level 3

Hi,

We are using QueryBuilder to do the search on our website.

We have a list of vanitys url's stored on a property called sling:vanityPath that is a multivalued property.

I want to put on the search criteria a restriction to search pages that contains some string on the vanity urls.

For example:

search pages that contains "en_us" on the property sling:vanityPath (that is a multivalued property).

Is it posible to do something like this?

I could not found anything similar on the internet, I appreciate any help.

Thank you very much in advance. 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Are you using SQL2? if yes, you can use below query

SELECT parent.* FROM [cq:Page] AS parent INNER JOIN [nt:base] AS child ON ISCHILDNODE(child,parent) WHERE ISDESCENDANTNODE(parent, '/content') AND child.[sling:vanityPath] IS NOT NULL

you can use child.[sling:vanityPath] LIKE 'en_us' also

if you are using Query Builder Debugger Tool, you can write like below:

type=nt:base

path:/content/

property:jcr:content/sling:vanityPath

property.operation:exists

you can use other property operation also e.g. "like" to search for particular keyword for vanity urls in properties



Arun Patidar

View solution in original post

3 Replies

Avatar

Level 3

I am looking for another answers,

and if it is posible to put a condition to verify if a property exists on the parent page of this page, this is something I can use.

is this posible or easier of my first question???

I remain attentive.

Thank you!

Avatar

Correct answer by
Community Advisor

Are you using SQL2? if yes, you can use below query

SELECT parent.* FROM [cq:Page] AS parent INNER JOIN [nt:base] AS child ON ISCHILDNODE(child,parent) WHERE ISDESCENDANTNODE(parent, '/content') AND child.[sling:vanityPath] IS NOT NULL

you can use child.[sling:vanityPath] LIKE 'en_us' also

if you are using Query Builder Debugger Tool, you can write like below:

type=nt:base

path:/content/

property:jcr:content/sling:vanityPath

property.operation:exists

you can use other property operation also e.g. "like" to search for particular keyword for vanity urls in properties



Arun Patidar

Avatar

Level 3

Hi,

It works!

Thank you very much for the help!