Expand my Community achievements bar.

SOLVED

search order when there is no "order by"

Avatar

Level 4

Hi guys,

I am trying to figure out if there is any "sorting" logic for queries that have no "order by" clause. Take for instance the following query:

select [jcr:path], [jcr:score], * from [dam:Asset] as a where contains(*, 'geometrixx') and isdescendantnode(a, '/content/dam')

How do results get put together? Does it work on a first found first returned basis? I would appreciate it if someone can point me in the right direction as to where to look for this information.

I am aware of the Oak Documentation here http://jackrabbit.apache.org/oak/docs/query/query-engine.html but alas, I wasn't able to find an answer there.

The query came from performing a search for "geometrixx" on the Assets console in AEM on the Keywords textbox in the search rail.

I am using AEM 6.1 SP2, Oak 1.2.16.

Thanks in advance : )

何塞。

1 Accepted Solution

Avatar

Correct answer by
Level 10

Without the Order BY - there does not seem to be an specific order. 

https://docs.adobe.com/docs/en/cq/5-6-1/dam/customizing_and_extendingcq5dam/query_builder.html

If you want to order your result set - i would recommend using Order BY. 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Without the Order BY - there does not seem to be an specific order. 

https://docs.adobe.com/docs/en/cq/5-6-1/dam/customizing_and_extendingcq5dam/query_builder.html

If you want to order your result set - i would recommend using Order BY.