Kibana visualize filter

Hello

We now create a data table in visualize.

Now we need to filter two data keyword in the same column.

For example,the content of table is:

cloumn count

data1 1

data2 1

data3 1

data4 1

data5 1

We want to add filter only to show data2 and data3 in the table.

If I use the "Add a filter" function to add two filter, the table will be empty.

I also modify the Query DSL with the command:

{
"query": {
"match": {
"column.keyword": {
"query": "data2",
"type": "phrase"
}
}
},
"query": {
"match": {
"column.keyword": {
"query": "data3",
"type": "phrase"
}
}
}
}

But the filter always only update to the latest query function,not two filter 'OR' logic.

How can I set these filter?

Maybe try;

"should" : [
        { "term" : { "data2" : "phrase" } },
        { "term" : { "data3" : "phrase" } }
      ],

From https://www.elastic.co/guide/en/elasticsearch/reference/6.0/query-dsl-bool-query.html

Thanks for you relpy.

It can works.

Awesome, can you share the entire thing, it might help someone in future :slight_smile:

The full Query DSL command is:

{
"query": {
"bool": {
"should": [
{
"match": {
"column.keyword": {
"query": "data2",
"type": "phrase"
}
}
},
{
"match": {
"column.keyword": {
"query": "data3",
"type": "phrase"
}
}
}
]
}
}
}

it's a "OR" condition.

1 Like

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