Expand my Community achievements bar.

SOLVED

Index configuration for excluding properties from fulltext search results

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Sudheer,

I would raise a daycare ticket referencing OAK-2281, asking for this feature. If there is enough demand, engineering will look into it.

Regards,

Opkar

View solution in original post

5 Replies

Avatar

Correct answer by
Employee

Hi Sudheer,

I would raise a daycare ticket referencing OAK-2281, asking for this feature. If there is enough demand, engineering will look into it.

Regards,

Opkar

Avatar

Employee

Hi Sudheer,

are you using AEM6 with CRX2? If so, this will not use the new OAK repository and all it's indexing features. Your previous indexing config should still work.

Regards,

Opkar

Avatar

Level 1

Hi,

We are working on AEM 6.1 with OAK Lucene migration project. Our existing production systems are on AEM 6.0 with CRX2 and we don't have any issues on production system.

My query is on how to get same indexing and query filtering get working on AEM 6.1 with OAK Lucene. 

OOTB Search functionality is one of our very big migration issue currently.

Avatar

Employee

Sorry Sudheer, misunderstood, it appears there was "excludePropertyNames" [1] in OAK until version 1.0.9

Also there is an open ticket [2] for conditional indexing rules, is that what you are looking for?

[1] http://jackrabbit.apache.org/oak/docs/query/lucene-old.html

[2] https://issues.apache.org/jira/browse/OAK-2281