Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

What will be the oak:index structure for following query

Avatar

Level 2

Hi All,

What will be the oak:index structure for the following xpath query

/jcr:root/content/dam/temp//element(*, nt:folder)

[

(jcr:content/@metadataSchema = '/conf/global/settings/dam/adminui-extension/metadataschema/temp')

]

1 Accepted Solution

Avatar

Correct answer by
Level 10

Try this-

  - compatVersion = 2

  - async = "async"

  - jcr:primaryType = oak:QueryIndexDefinition

  - evaluatePathRestrictions = true

  - type = "lucene"

  + indexRules

   + nt:folder

    + properties

     + metadataSchema

      - name = "jcr:content/metadataSchema"

      - propertyIndex = true

If you want this index to be picked up only for that path/query then include queryPaths/includedPaths or make it a non-root index

Jackrabbit Oak – Lucene Index

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Try this-

  - compatVersion = 2

  - async = "async"

  - jcr:primaryType = oak:QueryIndexDefinition

  - evaluatePathRestrictions = true

  - type = "lucene"

  + indexRules

   + nt:folder

    + properties

     + metadataSchema

      - name = "jcr:content/metadataSchema"

      - propertyIndex = true

If you want this index to be picked up only for that path/query then include queryPaths/includedPaths or make it a non-root index

Jackrabbit Oak – Lucene Index

Avatar

Level 4

Hi,

For any custom queries you can use this tool "Oak Utilities : Index Definition Generator" to check how your index definition will appears.

Hope this helps !

Thanks

Prem

Avatar

Level 2

Thanks gaurav. It is working as expected.