Ordered Index (deprecated since 1.1.8)
Extension of the Property index will keep the order of the indexed property persisted in the repository.
Used to speed-up queries with ORDER BY clause, equality and
range ones.
SELECT * FROM [nt:base] ORDER BY jcr:lastModified
SELECT * FROM [nt:base] WHERE jcr:lastModified > $date
SELECT * FROM [nt:base] WHERE jcr:lastModified < $date
SELECT * FROM [nt:base]
WHERE jcr:lastModified > $date1 AND jcr:lastModified < $date2
SELECT * FROM [nt:base] WHERE [jcr:uuid] = $id
To define a property index on a subtree you have to add an index definition node that:
- must be of type
oak:QueryIndexDefinition - must have the
typeproperty set toordered - contains the
propertyNamesproperty that indicates what properties will be stored in the index.propertyNameshas to be a single value list of typeName[]
Optionally you can specify
- the
reindexflag which when set totrue, triggers a full content re-index. - The direction of the sorting by specifying a
directionproperty of typeStringof valueascendingordescending. If not providedascendingis the default. - The index can be defined as asynchronous by providing the property
async=async
Caveats
- In case deploying on the index on a clustered mongodb you have to
define it as asynchronous by providing
async=asyncin the index definition. This is to avoid cluster merges.

