| Facets-class {rsolr} | R Documentation |
Facets
Description
The Facets object represents the result of a Solr facet
operation and is typically obtained by calling facets on
a SolrCore. Most users should just call
aggregate or xtabs instead of
directly manipulating Facets objects.
Details
Facets extends list and each node adds a grouping factor
to the set defined by its ancestors. In other words, parent-child
relationships represent interactions between factors. For example,
x$a$b gets the node corresponding to the interaction of
a and b.
In a single request to Solr, statistics may be calculated for multiple
interactions, and they are stored as a data.frame at the
corresponding node in the tree. To retrieve them, call the
stats accessor, e.g., stats(x$a$b), or as.table
for getting the counts as a table (Solr always computes the counts).
Accessors
-
x$name,x[[i]]: Get the node that further groups by the named factor. Theiargument can be a formula, where[[will recursively extract the corresponding element. -
x[i]: Extract a newFacetsobject, restricted to the named groupings. -
stats(x): Gets the statistics at the current facet level.
Coercion
as.table(x): Converts the current node to a table of conditional counts.
Author(s)
Michael Lawrence
See Also
aggregate for a simpler interface that
computes statistics for only a single interaction