What will be the oak:index structure for following query | Community
Skip to main content
Level 2
January 19, 2019
Solved

What will be the oak:index structure for following query

  • January 19, 2019
  • 3 replies
  • 2637 views

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')

]

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Gaurav-Behl

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

3 replies

Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
January 19, 2019

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

Premkarthic-7WP
Level 4
January 19, 2019

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

Level 2
January 20, 2019

Thanks gaurav. It is working as expected.