Simple vega table

I finally figured out how to query and get a metric back for a nested piece of data:

GET channel_statistics_long-*/_search
{
  "_source":"",
  "query": {
    "nested": {
      "path": "components",
      "query": {
        "bool": {
          "must": [{"match_phrase": {"components.content_type": "Video"}}]
        }
      },
      "inner_hits": {
        "_source": "components.pid"
      }
    }
  }
}

one of the results:

{
  "took" : 1097,
  "timed_out" : false,
  "_shards" : {
    "total" : 30,
    "successful" : 30,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 10000,
      "relation" : "gte"
    },
    "max_score" : 1.5403566,
    "hits" : [
      {
        "_index" : "channel_statistics_long-2024.02.05",
        "_type" : "_doc",
        "_id" : "2a2225837d43de515f11c6337d6b6f85",
        "_score" : 1.5403566,
        "_source" : { },
        "inner_hits" : {
          "components" : {
            "hits" : {
              "total" : {
                "value" : 1,
                "relation" : "eq"
              },
              "max_score" : 1.5403566,
              "hits" : [
                {
                  "_index" : "channel_statistics_long-2024.02.05",
                  "_type" : "_doc",
                  "_id" : "2a2225837d43de515f11c6337d6b6f85",
                  "_nested" : {
                    "field" : "components",
                    "offset" : 3
                  },
                  "_score" : 1.5403566,
                  "_source" : {
                    "pid" : 201
                  }
                }
              ]
            }
          }
        }
      },

For the life of me. I cannot get vega to make a simple table of

datetime | pid
datetime 201
datetime ...

I was trying to do this with just a column of time and a column of pids:

I also tried :

    format: {property: "hits.hits.inner_hits.components.hits"}

But I get :

Cannot read properties of undefined (reading 'components')

So part of my problem is I cannot access the pid value:

              "_source" : {
                "pid" : 201

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.