Could someone explain why these queries are not returning the same response?
This first query using script returns no records
GET /ind1/_search
{
"query": {
"bool": {
"must": [
{
"script": {
"script": """
doc['event_id'] == '10092831599'
"""
}
}
]
}
}
}
Whereas this query returns 1 record as expected.
GET /ind1/_search
{
"query": {
"term": {
"event_id": "10092831599"
}
}
}
Why is the script query not working in the same way as the term query? I have tried using single-quotes, double-quotes, using as a param value, but always the same result.... no records found...
The event_id
field is mapped as
"event_id" : {
"type" : "keyword"
},