querybuilder question: return pages with a component which has a specific custom property value?

Avatar

Avatar
Affirm 5
Level 4
TB3dock
Level 4

Likes

37 likes

Total Posts

223 posts

Correct reply

5 solutions
Top badges earned
Affirm 5
Ignite 10
Boost 25
Give Back 25
Validate 10
View profile

Avatar
Affirm 5
Level 4
TB3dock
Level 4

Likes

37 likes

Total Posts

223 posts

Correct reply

5 solutions
Top badges earned
Affirm 5
Ignite 10
Boost 25
Give Back 25
Validate 10
View profile
TB3dock
Level 4

22-03-2021

Hi, is there a way to return URLS for pages which have a component with a property of a specific value?

 

E.g. if there are say 1000 games, and each has an overview page, and each of these pages has a game overview component which has a game ID and game name property.

 

The client website has a list of recently played game ids, and needs to load some thumbnails which are aspects of the games overview page.

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Seeker
MVP
Suraj_Kamdi
MVP

Likes

148 likes

Total Posts

164 posts

Correct reply

42 solutions
Top badges earned
Seeker
Bedrock
Engage 1
Springboard
Validate 1
View profile

Avatar
Seeker
MVP
Suraj_Kamdi
MVP

Likes

148 likes

Total Posts

164 posts

Correct reply

42 solutions
Top badges earned
Seeker
Bedrock
Engage 1
Springboard
Validate 1
View profile
Suraj_Kamdi
MVP

22-03-2021

@TB3dock 

Use the following query builder query to get desired output 

path=/content/game
property=sling:resourceType
property.value=sample/components/structure/game-overview
group.1_property=gameId
group.1_property.value=0 (Optional)
group.2_property=gameName
group.2_property.value=0 (Otional)
group.p.and=true
p.limit=-1

 I am considering all the possible scenarios here as per provided description.

Answers (1)

Answers (1)

Avatar

Avatar
Give Back
Level 4
Sanket_Kumbharkhane
Level 4

Likes

46 likes

Total Posts

50 posts

Correct reply

20 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Give Back
Level 4
Sanket_Kumbharkhane
Level 4

Likes

46 likes

Total Posts

50 posts

Correct reply

20 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Sanket_Kumbharkhane
Level 4

22-03-2021

@TB3dock Yes, please use the query builder tool "/libs/cq/search/content/querydebug.html" to get the results with the help of the below query 

 

Search for specific property : 

path=/content/my-project

type=nt:unstructured

property=gameid

property.value=gameid-value

p.limit=-1

 

Search for property exist

path=/content/my-project

property=gameid

property.operation=exists

property.value=true

p.limit=-1

 

OR with SQL2 : 

 

All nodes where a property contains some String OR Value

SELECT * FROM [nt:unstructured] AS node

WHERE ISDESCENDANTNODE(node, "/search/in/path")

AND CONTAINS([propertyName], "someString")

 

Thanks,

Sanket