I need to search for something like this
POST dev_profiles/profiles/_search
{
"query": {
"bool": {
"filter": [
{
"query_string": {
"query": "user:asd"
},
"script_fields": {
"message_age": {
"script": {
"source": "return doc.createdAt.value.getHour() == params.h",
"params": {
"h": 9
}
}
}
}
}
]
}
}
}
but can't build a query in the right way. Can somebody help?
In that case, it gives error [query_string] malformed query, expected [END_OBJECT] but found [FIELD_NAME] version of elasticsearch 6.8