Hi @akashdeepm
As you must be aware queries like these work based on indexes in AEM. So if you try to search for a term using a type "cq:Page" it essentially searches based on indexes built for cqPageLucene you can check the configurations of these under "/oak:index/cqPageLucene"
Your observation is correct that when you use the type cq:Page you are getting results for node till "propNode" (level 4), and when you remove it you get it to subNode level as well. The reasoning is that:
- When you remove the type parameter "cq:Page" it essentially then traverses the entire hierarchy instead of getting the results based of indexes (performance will be poor as the search set increases)
- However when you add the type parameter "cq:Page" then the index depth is driven by aggregation rules defined under the index configuration: "/oak:index/cqPageLucene/aggregates/cq:PageContent" which is by default up-to 4 levels (refer screenshot below):
To understand more about index aggregation configurations in this documentation
I hope this answers your query,