Oak Index Definition Generator
Generates an index definition for a given set of queries
Queries
# Paste your queries here: SELECT * FROM [dam:Asset] AS a WHERE a.[jcr:content/metadata/status] = 'published' ORDER BY a.[jcr:content/metadata/jcr:lastModified] DESC # Multiple queries are supported SELECT * FROM [dam:Asset] WHERE CONTAINS([mimetype], 'text/plain') # XPath queries are also supported /jcr:root/content/dam/element(*, dam:Asset)[@valid]
Query Cheat Sheet
Back
Text
JSON
XML
- compatVersion = 2 - async = "async" - warningTagMissing = "Consider adding a tag to the query, via 'option(index tag abc)'. See also https://jackrabbit.apache.org/oak/docs/query/query-engine.html#query-option-index-tag . The query currently does not have a tag, which can result in the wrong index to be used. Also, it prevents to add 'selectionPolicy' = 'tag' to the index definition, meaning that other, unrelated queries might use this index by mistake." - queryPaths = [/content/dam] - includedPaths = [/content/dam] - jcr:primaryType = oak:QueryIndexDefinition - evaluatePathRestrictions = true - type = "lucene" + indexRules + dam:Asset + properties + valid - name = "valid" - propertyIndex = true - notNullCheckEnabled = true + mimetype - name = "mimetype" - analyzed = true + lastModified - name = "jcr:content/metadata/jcr:lastModified" - ordered = true + status - name = "jcr:content/metadata/status" - propertyIndex = true
{ "async": "async", "compatVersion": 2, "evaluatePathRestrictions": true, "includedPaths": ["/content/dam"], "jcr:primaryType": "oak:QueryIndexDefinition", "queryPaths": ["/content/dam"], "type": "lucene", "warningTagMissing": "Consider adding a tag to the query, via 'option(index tag abc)'. See also https://jackrabbit.apache.org/oak/docs/query/query-engine.html#query-option-index-tag . The query currently does not have a tag, which can result in the wrong index to be used. Also, it prevents to add 'selectionPolicy' = 'tag' to the index definition, meaning that other, unrelated queries might use this index by mistake.", "indexRules": { "jcr:primaryType": "nt:unstructured", "dam:Asset": { "jcr:primaryType": "nt:unstructured", "properties": { "jcr:primaryType": "nt:unstructured", "lastModified": { "jcr:primaryType": "nt:unstructured", "name": "jcr:content/metadata/jcr:lastModified", "ordered": true }, "mimetype": { "analyzed": true, "jcr:primaryType": "nt:unstructured", "name": "mimetype" }, "status": { "jcr:primaryType": "nt:unstructured", "name": "jcr:content/metadata/status", "propertyIndex": true }, "valid": { "jcr:primaryType": "nt:unstructured", "name": "valid", "notNullCheckEnabled": true, "propertyIndex": true } } } } }