FacetAggregator: Facet Aggregator

FacetAggregatorR Documentation

Facet Aggregator

Description

Faceted search aggregator for computing aggregations/counts

Methods

Public methods


Method aggregate()

Aggregate facet values from documents

Usage
FacetAggregator$aggregate(documents, facet_configs)
Arguments
documents

List of documents with metadata

facet_configs

List of field names or FacetConfig objects

Returns

Named list mapping field names to FacetResult


Method to_list()

Convert facet results to list format

Usage
FacetAggregator$to_list(facet_results)
Arguments
facet_results

Named list of FacetResult objects

Returns

List format suitable for JSON


Method clone()

The objects of this class are cloneable with this method.

Usage
FacetAggregator$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

## 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)


VectrixDB documentation built on Feb. 20, 2026, 5:09 p.m.