AEM6.3 - QueryBuilder - filter by properties that contains some string | Community
Skip to main content
elizabethp60981
New Participant
May 8, 2018
Solved

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

  • May 8, 2018
  • 3 replies
  • 3042 views

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. 

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 arunpatidar

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

3 replies

elizabethp60981
New Participant
May 9, 2018

Hi,

It works!

Thank you very much for the help!

arunpatidar
arunpatidarAccepted solution
New Participant
May 8, 2018

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
elizabethp60981
New Participant
May 8, 2018

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!