java - In AEM query builder order by based on someproperty=somevalue -




i m trying sort aem query builder search results based on particular value of particular property. have in database mysql can sort based on column's value (for exp. order field('columnname','anycolumnname'). can have in aem.

suppose have 5 assets under path /content/dam/assets.

asset name------------dc:title

1.jpg------------------apple

2.jpg------------------cat

3.jpg------------------cat

4.jpg------------------ball

5.jpg------------------drag

i need assets on top of results dc:title = cat , need other results in sorting asc. expected result given below

2.jpg------------------cat

3.jpg------------------cat

1.jpg------------------apple

4.jpg------------------ball

5.jpg------------------drag

note:- using version aem 6.2

you can use orderby predicate value of @jcr:content/metadata/dc:title sort dc:title querybuilder. /libs/cq/search/content/querydebug.html interface test queries on instance. acs commons has breakdown of out of box predicates

if want pull cats top of results single query, write custom predicate. sample code acs commons shows example. adobe has documentation well.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -