String stats aggregation

String stats aggregation #

A multi-value metrics aggregation computing length and character statistics over keyword/string values: count, min/max/avg length and Shannon entropy of the character distribution.

Example #

Four product types (t-shirt 7 chars ×60, hat 3 ×30, mug 3 ×20, sticker 7 ×10): count 120, min_length 3, max_length 7, avg_length ≈5.33.

Parameters for string_stats #

  • field
    (Required, string) Keyword field you wish to aggregate.
  • show_distribution
    (Optional, boolean, default: false) Also return the per-character frequency map.
Calendar September 26, 2026
Edit Edit this page