#community-help

Query about 'Stats' field in JSON Response

TLDR Harpreet asked about the "stats" field in a search result. Kishore Nallan explained it's for numerical variables, and recognized an issue with the YML api spec.

Powered by Struct AI
4
26mo
Solved
Join the chat
Nov 07, 2021 (26 months ago)
Harpreet
Photo of md5-745d880d794220d9f0fb9ade17c6b861
Harpreet
04:07 AM
Question about the search result:

    "facet_counts": [
      {
        "counts": [
          {"count": 8277, "highlighted": "salt", "value": "salt"}
        ],
        "field_name": "ingredient_names",
        "stats": {}
      }
    ],

What is returned in the "stats" field?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:11 AM
Stats is meant for numerical fields, stuff like min/max/average.
04:12
Kishore Nallan
04:12 AM
Looks like that's not part of our YML api spec, I will create an issue to add it.
Harpreet
Photo of md5-745d880d794220d9f0fb9ade17c6b861
Harpreet
04:23 AM
Okay, thanks