exclude a property we can add index(boolean) false on the property
I have added index(boolean) false on
but the issue is that even below jcr:content node - there are various nodes in a page - a responsive grid inside another responsive grid and when an author drops a component that component always has jcr:createdBy ; jcr:lastModifiedBy properties which have the content author's id/name
So I am planning to use
as mentioned in the doc to write a regex and then set index(boolean) false
Has anyone else faced the same issue and can help in excluding these jcr:createdby and jcr:lastModifiedBy properties in deep nodes ? Am I going in the right direction using isRegexp ?
If yes - what can be the right regex to exclude these properties from certain (n) level of nodes?
If a property is not to be part of full text search set the property -
nodeScopeIndex ->false(nodeScopeIndex set to true is responsible for a property being part of full text search)
If we set "index -> false", then the respective property will not be part of property constraint query result either/not indexed at all.
Also, property named analyzed -> false if the same is not to be part of contains query.
For restricting the property names using regex,
isRegexpcan be used to define the property name. Level of nodes up to which it is indexed is defined in "aggregates" node of cqPageLucene -> /oak:index/cqPageLucene/aggregates/cq:PageContent
Each include definition defines the level with respect to cq:Page node
Considering this and your content hierarchy, you can make use of isRegexp to frame the property name.
Note : The concern that you mentioned on "property name can be at any depth under cq:Page" can be controlled or handled using aggregates and property definition together. (In other words, depth of nodes to be indexed under cq:Page is defined with help of aggregates node. Even if it does at say 10th level, respective node might not have been indexed at first place unless we define them explicitly in include rule)
isRegex -> true
name -> jcr:content/*/*/*/.* (all properties of spacer node - jcr:content/root/responsivegrid/spacer)
name -> jcr:content/*/*/*/jcr:lastModifiedBy
analyzed -> false
nodeScopeIndex -> false
Your understanding is correct. I missed about the open issue
If your requirement is critical and need to be addressed by any means, consider the below.(approach not involving isRegexp, providing complete property path)
Per the aggregates defined as part of OOTB index - cqPageLucene (AEM 6.5.0), it indexes nodes 5 level below cq:Page node(Ex: jcr:content/root/responsivegrid/content_fragment/sample)
Properties that are part of testsample node in this path - jcr:content/root/responsivegrid/content_fragment/sample/testsample will not be indexed.
If the component nodes to be restricted is within this hierarchy and number of property paths(considering project content path patterns) to restrict is minimal, consider creating each of it providing full property path like jcr:content/root/responsivegrid/content_fragment/jcr:lastModifiedBy
Also, as part of my trial in my local, could see that nodeScopeIndex/analyzed -> false is not restricting at times. You can try and if it is the same for you, use property named "excludeFromAggregation" -> true [Boolean] on the property instead.
Providing full property path (without regex which works only for property names not for intermediate nodes) + "excludeFromAggregation" should work. Please try and update this thread.
Note that the regular expression doesn’t match intermediate nodes, so, jcr:content/.*/.* would not index all properties for all children of jcr:content. OAK-5187 is an open improvement to track supporting arbitrary intermediate child nodes.
I tried adding a node with
and name as jcr:content/*/*/*/jcr*
and it still returned the result with author name (it is not excluding the property)