Message-ID: <300439615.2858.1485851029009.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2857_1038456724.1485851029009" ------=_Part_2857_1038456724.1485851029009 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Sort Clauses Reference

Sort Clauses Reference

=20
=20
=20
=20

Sort Clauses are the sorting options for = Content and Location Search in eZ Platform. For generic use of API Search s= ee Search Criteria and Sort Clauses.

A Sort Clause consists of two parts just like Criterion and Face= tBuilder:

  • The API Value: SortClause
  • Specific handler per search engine: SortClausesHandler

The SortClause represents the value you use in th= e API, while SortClauseHandler deals with th= e business logic in the background, translating the value to something the = Search engine can understand.

Implementation and availability of a handler sometimes depends on s= earch engine capabilities and limitations.

Common conc= epts for all Sort Clauses 

For how to use each and every Sort Clause, see list below a= s it depends on the Sort Clause Value constructor, but in general you should be aware of the following common concept:=

  • sortDirection: The direction to perform the sort, eithe= r Query::SORT_ASC<= /span>(default) or Query:: SORT_DESC


 

V1.6.0

You can use the method SearchService::getSortClauseFromLocation( L= ocation $location ) to return an array of Sort Clauses that you can = use on LocationQuery->sortClauses.


List of Sort C= lauses 

The list below reflects Sort Clauses available in the = eZ\Publish\API\Repository\Values\Content\Query\SortClause namespace (it is also possible to = make a custom Sort Clause):

Arguments starting with "?" are optional.

Only for LocationSear= ch

Sort Clause Constructor arguments description
Location\Depth <= /td> ?sortDirection
Location\Id  ?sortDirection<= /code>
Location\IsMainLocation = ; ?sortDirection<= /code>
Location\Depth <= /span> ?sortDirection<= /code>
Location\Priori= ty  ?sortDirection<= /code>
Location\Visibility  ?sortDirection

 

Common

Sort Clause Constructor arguments description
ContentId ?sortDirection
ContentName ?sortDirection=
DateModified ?sortDirection
DatePublished = ?sortDirection
Field

typeIdentifier as = string, fieldIdentifier as string, ?sortDirection, ?languageCode as string

MapLocationDistance  typeIdentifier= as string , fieldIdentifier as string , latitude as = float ,   longitu= de as float, ? sor= tDirection, ?languageCode as string
SectionIdentifier  ?sortDirection
SectionName  ?sortDirection
=20
=20
=20
=20

In this topic:

=20
=20
=20
------=_Part_2857_1038456724.1485851029009--