SortClauses are the sorting options for Content and Location Search in "Platform stack", for generic use of API Search see Search Criteria and Sort Clauses
SortClause consists of two parts just like Criterion and FacetBuilder:
Specific handler per SearchEngine: "SortClausesHandler"
The SortClause
represent the value you use in the API, while SortClauseHandler
deals with the business logic in the background translating the value to something the Search engine can understand.
Implementation and availability of a handler sometimes depends on SearchEngine capabilities/limitations. |
For how to use each and every SortClause see list below as it depends on the SortClause Value constructor, but in general you should be aware of the following common concept:
sortDirection
: The direction to perform the sort, either Query::SORT_ASC
(default) or Query::SORT_DESC
The list below reflects Sort Clauses available in eZ\Publish\API\Repository\Values\Content\Query\SortClause
namespace (it is also possible to make custom SortClause):
Arguments starting with " |
Sort Clause | Constructor arguments description |
---|---|
Location\Depth ![]() | ?sortDirection |
Location\Id ![]() | ?sortDirection |
Location\IsMainLocation ![]() | ?sortDirection |
Location\Depth ![]() | ?sortDirection |
Location\Priority ![]() | ?sortDirection |
Location\Visibility ![]() | ?sortDirection |
Sort Clause | Constructor arguments description |
---|---|
LocationDepth ![]() | Use LocationSearch with Location\Depth , since LocationDepth can give unpredictable results when content has several locations. |
LocationPath ![]() | |
LocationPathString ![]() | |
LocationPriority ![]() | Use LocationSearch with Location\Priority , since LocationPriority can give unpredictable results when content has several locations. |
Sort Clause | Constructor arguments description |
---|---|
ContentId | ?sortDirection |
ContentName | ?sortDirection |
DateModified | ?sortDirection |
DatePublished | ?sortDirection |
Field |
|
MapLocationDistance ![]() | typeIdentifier as string, fieldIdentifier as string, as float, as float, ?sortDirection as string |
SectionIdentifier | ?sortDirection |
SectionName | ?sortDirection |