Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Querybuilder query multiple paths and other properties

NitroHazeDev
Level 7
Level 7

I do have a question on query builder query and if it is the apt way to proceed on 6.5.8

I have a structure as below

/var/test/user

  /A

    /0222223ead

  /B

   /234534rrr43 

and  58 more direct children for /var/test/user

I want to query for a property with a value "x", and link contains "/content/dam/y" and within a date range for "created" ordered by "created" and sort it.

 

The Querybuilder query i can think of is below. I would like to know if there is 

1. a limit to the number of "group" keyword used, while i am sure passing too many will perhaps lead to bad request with too many header fields.

2. way to optimize the query for a system with huge number of nodes under that structure (nested 8 levels deep)

3.Should i split it into multiple queries and merge?

4. Using below query should i be seeing "Filtering predicates"  displaying something? It appears to be blank in Query builder 

NitroHazeDev_0-1642003820821.png

 

 

Takes 50 seconds 

 

Query

type=nt:unstructured
group.1_path = /var/test/user-info/0
group.2_path =/var/test/user-info/1

:

:

group.n_path =/var/test/user-info/n

group.p.or=true
1_property = action
1_property.value = X
2_property = @node/link
2_property.operation = like
2_property.value = /content/dam/y/assets/%
3_daterange.property = created
3_daterange.upperBound = 2022-01-01T12:09:00.000-05:00
3_daterange.lowerBound = 2021-06-01T12:09:00.000-04:00
orderby = created
orderby.sort = desc
p.limit=40000
p.offset=0
p.guesstotal=40000

 

3 Replies
DEBAL_DAS
Level 5
Level 5

Here , user-info [/var/test/user-info] is having 60 children and you are targeting immediate children of 0,1.... n.

I feel instead of having multiple groups associated with path, you could have used 

type= nodetype [jcr:primaryType] of 0222223ead, 234534rrr43 
path=/var/test/user-info

 

If incase node type [jcr:primaryType] of 234534rrr43, 0222223ead is similar to user-info node, in that case  you can get expected result by adding date range, required property like action, link. 

 

Suppose you are targeting nodes[children] under multiple paths like /var/test/user-info and /var/test/demo and both are having different types children [jcr:primaryType], then you can use group associated with paths.

 

Below you could see I am targeting nodes like 425b2b8f-50f0-45ab-b8b4-e210d906b71c and my query -

type=cq:AuditEvent
path=/var/audit/com.day.cq.wcm.core.page/conf/demo
1_property = cq:path
1_property.operation = like
1_property.value = /conf/demo/settings/wcm/templates/page-content%
p.limit=-1

 

DEBAL_DAS_1-1642009378469.png

 

As of now practically I haven't seen merging of two different query builder queries. 

 

Requesting @Arun_Patidar , @Jörg_Hoh and others to correct me and add more valuable points.

 

 

 

NitroHazeDev
Level 7
Level 7

Thanks @DEBAL_DAS ... i could have but the other properties i am searching for are a mix of properties and nodes containing properties.. I ran batching for the query in the original question  and it seems to have done the job but will keep an eye on anyones input here

DEBAL_DAS
Level 5
Level 5

@NitroHazeDev , long back I used the below querybuilder query with mix of properties and multiple paths -

 

DEBAL_DAS_0-1642236574022.png

If I see get anything in terms of merging of multiple queries then I will share with you immediately.