Order
Order the document results.
Beta
The Optimizely Graph .NET Client is in beta. Contact your Customer Success Manager for information.
Use the OrderBy
method in TypeQueryBuilder
to order your result. The method OrderBy()
has the following parameters:
OrderMode
– An enumerator that sorts the value of a field inDESC
(descending) orASC
(ascending) order.Ranking
– An enumerator used for sorting on scores. It contains the valuesRELEVANCE
,SEMANTIC
,BOOST_ONLY
, andDOC
. For how to use these options, see Optimizely Graph OrderBy .
You can order by multiple fields, for example:
var query = queryBuilder
.ForType<MyDocument>()
.Fields(x=>x.Property1)
.OrderBy(x=>x.Property1, OrderMode.ASC, Ranking.BOOST_ONLY)
.OrderBy(x=>x.Property2, OrderMode.DESC)
.ToQuery()
.BuildQueries();
Updated 3 months ago