I am using Vega to create my Visualization. I want to put kibanaAddFilter so that on click it filter out a field's multiple selected values.
Like a field XYZ contains values( a,b,c,d,e,f,g). The filter should filter out a,b,c values on click.
I tried multiple ways to put it:-
signals: [
{
name: point_click_1
on: [
{
events: {
source: scope
type: click
}
update:
'''
kibanaAddFilter({
"match_phrase":{
"XYZ.keyword": "a" or "b" or "c" or "d" or "e" or "f" or "g" or "h"
}
},'dataname')
'''
}
]
}
]
This above code is giving expression parse error.
I also tried -
signals: [
{
name: point_click_1
on: [
{
events: {
source: scope
type: click
}
update:
'''
kibanaAddFilter({
"match_phrase":{
"XYZ.keyword": "a or b or c or d or e or f or g or h"
}
},'dataname')
'''
}
]
}
]
This above code is not throwing error but not working as required. I believe it's taking the whole line as a phrase and checking that.
Hello @Alexis_Roberson
I am not an expert on Vega, but I can share with you an example I've edited from this documentation page.
Install the sample data commerce data to test this.
Expand the time picker to a wide time range to match some document of the sample.
Click on one of the black dots in the graph.
You should see a filter being applied with a terms filter on the field currency, hardcoded to EUR.
Ya I found that I was missing square brackets for writing all values. That's why it was putting filter but wasn't working properly. The dashboard was going blank as no condition matched.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.