| FacetAggregator | R Documentation |
Faceted search aggregator for computing aggregations/counts
aggregate()Aggregate facet values from documents
FacetAggregator$aggregate(documents, facet_configs)
documentsList of documents with metadata
facet_configsList of field names or FacetConfig objects
Named list mapping field names to FacetResult
to_list()Convert facet results to list format
FacetAggregator$to_list(facet_results)
facet_resultsNamed list of FacetResult objects
List format suitable for JSON
clone()The objects of this class are cloneable with this method.
FacetAggregator$clone(deep = FALSE)
deepWhether to make a deep clone.
## Not run:
aggregator <- FacetAggregator$new()
facets <- aggregator$aggregate(
documents = list(
list(category = "tech", author = "Alice"),
list(category = "science", author = "Bob")
),
facet_fields = c("category", "author")
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.