Hi,
suppose we have the following docs: (index name is test_index)
{
session_id: "123",
"session_details":[
{
"page": "/abc"
},
{
"page": "/xyz"
}
]
}
{
session_id: "456",
"session_details":[
{
"page": "/abc"
},
{
"page": "/qwe"
}
]
}
mappings is like this:
{
"session_id" : {
"type" : "keyword"
},
"session_details" : {
"type" : "nested",
"properties" : {
"page" : {
"type" : "keyword"
}
}
}
}
if I run the following query I expect to receive the doc with the session_id = 123
but I receive both docs, any explanation ?
GET test_index/_search?ignore_unavailable=true
{
"track_total_hits": true,
"size": 10,
"query": {
"bool": {
"filter": [
{
"nested": {
"path": "session_details",
"query": {
"bool": {
"filter": [
{
"wildcard": {
"session_details.page": "*/abc*"
}
},
{
"bool": {
"must_not": [
{
"wildcard": {
"session_details.page": "*/xyz*"
}
}
]
}
}
]
}
}
}
}
]
}
}
}