I try to update query of the component by using setQuery() prop. My data is structured like this.
{
root : {
category 1: {
item 1 {...},
item 2 {...},
},
category 2: {
item 1 {...},
item 2 {...},
},
...
}
}
I need to get item 1 under the category 1. When user select item 1 I update query like this. But it doesn't work.
this.props.setQuery({
"query": {
"bool": {
"must": [
{
"query_string": {
"query": 'category 1 AND item 1',
"fields": ["item", "category", "keywords"],
"analyzer": "standard"
}
}
]
}
}
});
I try find out how to solve this using nested query. But I couldn't find any use full thing. Please give me any clue to achieve this.