I have an index in with time field, and for each time there are multiple documents.
I want to present only the results of the latest time. how can I do it?
Is there a way to calculate the maximum value of the time field over all documents, and then apply a filter based on this value?
here is an example of the code:
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
data: {
data: table
url: {
%context%: true
%timefield%: Time
index: data*
body: {
size: 10000
_source: ["X", "Y"]
}
}
format: {property: "hits.hits"}
}
mark: {type: "square", filled: true, size: 800 }
encoding: {
x: {
field: "_source.X"
type: quantitative
axis: {title: "X"}
}
y: {
field: "_source.Y"
type: quantitative
axis: {title: "Y"}
}
}
}