It might be that I am not using the plugin in the intended way. Essentially I am trying to plot the data which is returned by the query from the Elasticsearch. My pet peeve was my inability (or ignorance!!) to plot the data straight out of the results of an Elasticsearch query. I thought that Vega can help since I can sneak in my ES query and then plot/do stats on results. As you can see there are no aggs involved in the ES query. Timepicker and filter context will not work as per my understanding.
Here is my vega schema:
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"title": "Test",
"data": {
"url": {
"index": "log-demo-2019.11",
"body": {
"size": 1000,
"_source": ["@timestamp", "_score", "fields.StepNumber", "fields.Reading.Value"],
"query": {
"bool": {
"should": [
{"match": {"fields.StepNumber": "PX_Run_1"}},
{"match": {"fields.StepNumber": "PX_Run_2"}},
{"match": {"fields.StepNumber": "PX_Run_3"}},
{"match": {"fields.StepNumber": "PX_Run_4"}},
{"match": {"fields.StepNumber": "PX_Run_5"}},
{"match": {"fields.StepNumber": "PX_Run_6"}}
],
"minimum_should_match": 1
}
}
}
},
"format": {"property": "hits.hits"}
},
"mark": "point",
"encoding":
{
"tooltip": {"field": "_source.fields.Reading.Value", "type": "quantitative"},
"x":
{
"field": "_source.fields.StepNumber",
"type": "nominal",
"axis": {"title": "Dev Runs"},
}
"y":
{
aggregate":"average",
"field": "_source.fields.Reading.Value",
"type": "quantitative",
"axis": {"title": "Perf"}
}
}
}
I think Vega is seeing and plotting each result. Like the 180 hits I got for this.
I was expecting just 6 points, each denoting the average for each of the runs. But the experiment failed.
Is there any way I can make Vega see the result as a whole and plot it right?
