Class DocumentStats

java.lang.Object
io.fluxcapacitor.common.api.search.DocumentStats

public class DocumentStats extends Object
Represents aggregate statistics for a group of documents, including values for specified fields.

Grouping is defined by a Group key (based on document field values), and statistics are computed per requested field path.

See Also:
  • Constructor Details

    • DocumentStats

      public DocumentStats()
  • Method Details

    • compute

      public static List<DocumentStats> compute(Stream<Document> documents, List<String> fields, List<String> groupBy)
      Computes document statistics from a stream of documents.
      Parameters:
      documents - Stream of input documents
      fields - Fields to compute statistics for
      groupBy - Paths to group by
      Returns:
      A list of DocumentStats, one per group