Where the un-named facets come from
With no facet named, a facet query counts every facetable property of every node type in the result. Naming a facet turns this off. These methods choose explicitly, and combine with the facets you name:
| Method | Adds |
|---|---|
AddFacetsOfType() |
The query type's properties, own and inherited; includeDescendants: true adds its subtypes' |
AddFacetsOfResult() |
The properties of every type in the result: the default when nothing is named |
OnlyNamedFacets() |
Nothing. A selection still filters, but no buckets are counted |
ExcludeFacet(…) |
Leaves a property out, however it came in; a selection on it still filters |
var result = db.Query<IEvent>()
.Facets()
.AddFacetsOfResult() // everything facetable in the result
.AddRangeFacet(e => e.Price) // …with Price as ranges
.ExcludeFacet(e => e.Title)
.SetFacetValue<IConcert>(c => c.Stage, "Main") // a property of one subtype
.Execute();A property found this way is left out when it would have more than 100 buckets of single values.
Raise the limit with maxDistinctValues on AddFacetsOfType or AddFacetsOfResult (-1 for
none). AddFacetsOfType(includeDescendants: true) keeps a sidebar's shape: a search that matches
nothing still returns every facet, with zero counts.