Index configuration for excluding properties from fulltext search results
Requirement: To exclude few properties on component nodes under jcr:content node so that when fulltext search is performed, query ignores Nodes/pages which matches with fulltext search term of excluded properties term.
Index configuration created as below:
Created Index under: /content/projectname/www/en-us/locations/
<oak:index
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="nt:unstructured">
<sdpPageContentLucene
jcr:primaryType="oak:QueryIndexDefinition"
async="async"
compatVersion="{Long}2"
includePropertyTypes="[String,Binary]"
reindex="{Boolean}false"
reindexCount="{Long}19"
type="lucene">
<aggregates jcr:primaryType="nt:unstructured">
<cq:PageContent jcr:primaryType="nt:unstructured">
<include0
jcr:primaryType="nt:unstructured"
path="*"
relativeNode="{Boolean}false"/>
<include1
jcr:primaryType="nt:unstructured"
path="*/*"
relativeNode="{Boolean}true"/>
<include2
jcr:primaryType="nt:unstructured"
path="*/*/*"
relativeNode="{Boolean}true"/>
<include3
jcr:primaryType="nt:unstructured"
path="*/*/*/*"
relativeNode="{Boolean}true"/>
</cq:PageContent>
</aggregates>
<indexRules jcr:primaryType="nt:unstructured">
<cq:PageContent jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<serviceslabel
jcr:primaryType="nt:unstructured"
analyze="{Boolean}false"
index="{Boolean}false"
name="jcr:content/comp1/serviceslabel"
nodeScopeIndex="{Boolean}false"
type="String"/>
<text
jcr:primaryType="nt:unstructured"
analyze="{Boolean}false"
index="{Boolean}false"
name="jcr:content/comp2/text"
nodeScopeIndex="{Boolean}false"
type="String"/>
</properties>
</cq:PageContent>
</indexRules>
</sdpPageContentLucene>
</oak:index>
I have tried creating same index configuration under /oak:index, Lucene is not even considering my index in that case. Also, I have tried all the combinations of index=true/false, nodeScopeIndex=true/false and analyze=true/false.
I am not sure where am I going wrong with this index configuration. Can we influence query results by creating indexes or indexes just to run queries faster?
I have read "http://jackrabbit.apache.org/oak/docs/query/lucene.html" documentation many times to figure out the issue but no luck so far.
I would be great if I can get some help on this requirement.
Our current production systems are running on AEM 6.0 with JCR 2.x and I was able to achieve this requirement by using indexing_config.xml configuration.