Expand my Community achievements bar.

Registration for the AEM Guides User conference on 24th and 25th March 2024 is open.

AEM 6.5.4 Query predicate fulltext with type cq:Page does not search query term under all the child nodes but only to a certain depth

Avatar

Level 1

My current query with predicate type=cq:Page does not finds property from subNode but only finds till node level propNode 

/ jcr:content / comp-par / component / section / propNode / subNode


CurrentQuery:
-------------------
fulltext=Search Term
group.p.or=true
group.1_path=/content/proj/sub/us
group.1_group.type=cq:Page
group.2_path=/content/dam/proj/sub/us
group.2_group.type=dam:Asset

But when i remove the "group.1_group.type=cq:Page" then below fulltext query looks under entire depth and fetch all nodes containing the term

UpdatedQuery:
-------------------
fulltext=Search Term
group.p.or=true
group.1_path=/content/proj/sub/us
group.2_path=/content/dam/proj/sub/us
group.2_group.type=dam:Asset

With this nodes containing search term are returned while we expect the cq:page to be returned as in previous query.

Do we know what controls the depth for fulltext search with type=cq:Page. fulltext query without the type looks under entire depth.

And how can we get only cq:Page in search results when using updated query.

cc @kautuk_sahni Jörg_Hoh Arun_Patidar
Thanks

 

1 Reply

Avatar

Employee

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):

DivrajSingh_0-1620736034378.png

 

To understand more about index aggregation configurations in this documentation

 

I hope this answers your query,