How to exclude a node's property from the search indexing

Question

How do i exclude a node's property from the search indexing?

Answer, Resolution

This can be done in the indexing_config.xml found in (/crx-quickstart/server/runtime/0/_crx/WEB-INF/classes).

You will need to use the nodeScopeIndex attribute that controls whether a string property is added to the full text index. This is used when you do a jcr:contains(., 'foo') instead of jcr:contains(@prop, 'foo').

In CQ5.2.1 and earlier, this is an all inclusive. Instead of excluding them using the index-rule, you will need to explicitly include these properties that are required. These properties that are listed will be indexed and a property that isn"t listed will not be indexed.

If there are no index rules (by the default installation), all properties of the node are indexed.

Example to include a property for the index-rule (CQ5.2.1 and earlier)

<index-rule nodeType="nt:base"> 
<property nodeScopeIndex="true">cq:Template</property> 
<property nodeScopeIndex="true">subtitle</property> 
. 
. 
</index-rule> 

In CQ5.3, you don"t need to explicitly include these properties that require to be indexed. Now, you can exclude them which makes it easier to maintain. There is a list of known properties of a node that are unnecessary (by the default installation) which are excluded. There is a index-rule property isRegexp which includes all the rest of the properties to be indexed.

Example of exclude a property for the index-rule (CQ5.3)

<index-rule nodeType="nt:base"> 
. 
. 
<property nodeScopeIndex="false">sling:vanityPath</property> 
<property isRegexp="true">.*:.*</property> 
</index-rule> 

Applies to

CQ5.x

 Adobe

Gaukite pagalbą greičiau ir lengviau

Naujas vartotojas?