Hello together,
I have a Query in my Vega data-body which gives me some news titles. I print them in rows with a marks in marks section as you can see in the upcoming.
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "A bar chart of flight statistics, aggregated by the selected time unit.",
"padding": 30,
"autosize": {"type": "fit", "resize": true, "contains": "padding"},
"signals": [
{
name: point_click
on: [{
events: {
source: scope
type: click
markname: point
}
update: '''kibanaAddFilter({ "match_phrase": {
"title_keyword": "How_To_Access_Title_Keyword_In_Here?"
}}, 'clusters')'''
}]
}
],
"title": {
"text": "First Published",
"subtitle": "",
"subtitleFontStyle": "italic",
"frame": "group",
"anchor": "start",
"offset": 10
},
"layout": {
"padding": 10,
"columns": 2,
"align": "all"
},
"data": [{
"name": "FirstPublished",
"url":{
index: "clusters",
body: {
query: {
nested: {
path: "articles",
query: {
bool: {
must: [
// This string will be replaced
// with the auto-generated "MUST" clause
"%dashboard_context-must_clause%"
{
range: {
// apply timefilter (upper right corner)
// to the @timestamp variable
first_date: {
// "%timefilter%" will be replaced with
// the current values of the time filter
// (from the upper right corner)
"%timefilter%": true
}
},
"range":{
"articles.delay": { "lte": 0 }
}
}
]
must_not: [
// This string will be replaced with
// the auto-generated "MUST-NOT" clause
"%dashboard_context-must_not_clause%"
]
filter: [
// This string will be replaced
// with the auto-generated "FILTER" clause
"%dashboard_context-filter_clause%"
]
}
}
}
}
}
}
"format": {
"property": "hits.hits"
}
}],
"marks": [
{
"name": "point",
"type": "group",
"from": { "data": "FirstPublished" },
"marks": [
{
"type": "text",
"encode": {
"update": {
"x": {"value": 0},
"y": {"value": 0},
"text": {"field": {"parent" : "_source.title_keyword"}} "cursor": {"value": "pointer"},
"fill": {"value": "Black"}
}
"hover": {"fill":{"value":"Teal"}}
}
}
]
}
]
}
When clicking on a title I want to filter for this title in my Dashboard with the help of "kibanaAddfilters". I have done this several times and it works great. The problem here is that I am using a marks in marks section and I don't know how to access the "_source.title_keyword" inside my KibanaAddFilter function inside the update part of my signal. Normally I can access the value with "datum.fieldname" but since I am using "parent.fieldname" inside my marks section this is not working.
Does anybody has an idea how I can access the corresponding "_source.title_keyword" inside my KibanaAddFilter function when clicking on it?
Many Thanks for any of your help!