Creating a property oak index at the project level

lksfjhadfas

24-01-2019

Hello Everyone,

I am trying to create a property index at the project level where the path would be content/project/oak:index

The same index if kept in the default oak:index folder gets picked up for all the queries. But if i have it in the project folder it doesnt.

Any idea why?

Thank you so much!

Accepted Solutions (0)

Answers (9)

Answers (9)

Gaurav-Behl

MVP

28-01-2019

Did you get a chance to check screenshots posted above?

1) Check if the index is picked up and no issues with syntax -

http://localhost:4502/libs/granite/operations/content/diagnosistools/indexManager.html

2) Add 'nodeTypeListDefined' and 'declaringNodeTypes', if you want to restrict it to certain nodes for lower cost

3) Check if index stats are getting generated, perform reindex and check the logs -

http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3DProperty+Index+statistic...

4) Check the permissions on this path /content/project/oak:index - the service users should have read permissions, if not already available.

Refer - Jackrabbit Oak – The Property Index

  • declaringNodeTypes (Name, multi-valued): the index only applies to a certain node type.
  • includedPaths (String, multi-valued): the paths that are included (‘/’ if not set). Since Oak version 1.4 (OAK-3263). The index is only used if the query has a path restriction that is not excluded, and part of the included paths.

Jörg_Hoh

Employee

27-01-2019

You need to limit the query explicitly to that folder (as outlined in the example of gauravd83019631​).

Your approach is possible but In most cases even project indexes are dropped into /oak:index.

Gaurav-Behl

MVP

24-01-2019

Below are the screenshots. What message do you get in your case? Does it generate the stats?

1675696_pastedImage_0.png

1675763_pastedImage_1.png

1675764_pastedImage_2.png

1675765_pastedImage_3.png

*INFO* [qtp175495745-1958] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Indexing report

    - /content/we-retail/oak:index/myNodeApps*(4)

lksfjhadfas

24-01-2019

Here is the index xml

<oak:index jcr:primaryType="nt:unstructured">

        <email

            jcr:primaryType="oak:QueryIndexDefinition"

            info="Oak Index used for searching by email"

            propertyNames="{Name}[email]"

            reindex="{Boolean}false"

            reindexCount="{Long}3"

            type="property"

            unique="{Boolean}false"/>

    </oak:index>