Hi Jeff. I see you’re having difficulty figuring out how to use the facets in the search meta pipeline. We recognize that our existing documentation is a bit sparse on this use case and our team is already planning to expand documentation to address this question.
In the meantime, hopefully I can help.
The short answer is that you can include your facet definition using an additional pipeline stage (facet) and that the query should take the form of:
var result = GetTestCollection().Aggregate()
Builders.Search.Phrase(x => x.Body, "life, liberty, and the pursuit of happiness"),
Builders.SearchFacet.String("string", x => x.Author, 100),
Builders.SearchFacet.Number("number", x => x.Index, 0, 100),
Builders.SearchFacet.Date("date", x => x.Date, DateTime.MinValue, DateTime.MaxValue)))
You can also reference the API docs for the Facet pipeline stage here.
I’m out of office for the next few days, but I’ll check back in on Monday to see how things are looking. Hope this helps!