Creating a property oak index at the project level | Community
Skip to main content
lksfjhadfas
Level 2
January 24, 2019
Question

Creating a property oak index at the project level

  • January 24, 2019
  • 9 replies
  • 4576 views

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!

9 replies

Gaurav-Behl
Level 10
January 24, 2019

Could you share the index definition? It should work at your project level /content/project/oak:index

smacdonald2008
Level 10
January 24, 2019

OAK index has specific standards to make it work. I recommend that you watch this GEMS session.

Adobe Experience Manager Help | Oak Lucene Indexes

lksfjhadfas
Level 2
January 24, 2019

We have Lucene indexes at the same level and they are working fine. This one is a single property index.

lksfjhadfas
Level 2
January 24, 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>

Gaurav-Behl
Level 10
January 25, 2019

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

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

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

joerghoh
Adobe Employee
Adobe Employee
January 27, 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.

lksfjhadfas
Level 2
January 28, 2019

i am using

select * from [nt:base] as a where isdescendantnode(a, '/content/project') and a.[email]='test@test.com'

but it says

sreedobe
Level 4
March 18, 2025

I am facing same issue, were you able to solve?

I have two property indexes defined at "/content/dam/personal-site/oak:index".

 

Interesting thing is if I move these property indexes to '/oak:index" default out of the box location, property indexes picked by query. But not when indexes defined at "/content/dam/personal-site/oak:index".

 

 

Any ideas , what I am missing.

 

cc: @gaurav-behl @joerghoh 

lksfjhadfas
Level 2
January 28, 2019

It does generate the stats but says that no indexes are used, this is a traversal query.

Gaurav-Behl
Level 10
January 28, 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+statistics%2Ctype%3DPropertyI…

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.