Table of Contents

Class FacetRequest

Namespace
TantivyDotNet
Assembly
TantivyDotNet.dll

Asks Search(Query, SearchOptions) to count the matching documents in each child category of some facet paths. The counts appear in Facets under Field.

public sealed class FacetRequest
Inheritance
FacetRequest
Inherited Members

Examples

var results = searcher.Search(query, new SearchOptions { Facets = [new FacetRequest("genre", "/")] });
foreach (var (path, count) in results.Facets["genre"]) Console.WriteLine($"{path}: {count}");
// /fiction: 12
// /history: 3

Constructors

FacetRequest(string, params IEnumerable<string>)

Counts the children of each of paths in facet field field.

Properties

Field

The facet field.

Paths

The parent categories whose children are counted.

Top

If set, return only this many children per path, those with the highest counts, highest first. If null (the default), return every child that has matches, in path order.