I'm trying to figure out how to go about defining a sort when building a query for an item query (this is driving the results of an SXA page list). When in the query builder, I see that sort is an option, but it's unclear after typing sort: what the builder is expecting next. A GUID of a field to sort? Also, I am not finding any kind of documentation talking about if you are able to define ascending / descending in the sort or really anything about it other than it's existence. If anyone has some background on this, I would really appreciate it.
This is Sitecore specific, not SXA. When you build a query you need to specify a field that will be used for sorting. Then when you click on the sort icon you can change it to descending or ascending.
Here is a quick demo
I just build a query to search for items of template
Blog Post and sort them using custom field:
The raw values of my queries are:
I am not sure where you put your query (directly into a data source field or on item) but recommended location is ItemQuery item (
I published a few days ago a blog post which touches this topic. You could learn how to do it by reading Item Queries section.
You will also find step by step instruction how to configure sorting for
Search Results in case you switch from