HomeDev guideAPI ReferenceGraphQL
Dev guideUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Facets selection

Select facet by field.

The Optimizely Graph .Net Client supports faceting or aggregating documents using the Facet method. You must specify the field or fields you want to facet.



The Optimizely Graph .NET Client is in beta. Contact your Customer Success Manager for information.

The following is an example of a simple "facet" that facets the documents based on the value of the FacetProperty field:

var query = queryBuilder

Facet projection

By default, the result of the facet contains a Name and Count field. Use the Projection method on IFilterOperator to get your desired field.

var stringFacetFilter = new StringFacetFilterOperator()
  .OrderBy(x=>x.Property1, OrderMode.DESC)
  .Projection(FacetProperty.Name); //get only facet name

var query = queryBuilder
  .Facet(x=>x.Title, stringFacetFilter)