Multi match nested query with filter not working

Hi,
Below is the sample data i have in my cluster,

"_source" : {
"@timestamp" : "2019-06-28T15:20:24.178Z",
"@version" : "1",
"case" : {
"peerid" : "365768",
"isconfidential" : "true",
"category_keyword" : "Clients",
"status" : "INPROGRESS",
"ownername" : "Atul Bathla",
"team_keyword" : "C&IB - Clearing",
"type" : "CASE",
"closeddate" : "12-SEP-19 12.00.00.000000000 AM",
"ownername_keyword" : "Atul Bathla",
"desc" : "access as per the file",
"modifieddate" : "30-MAR-19 12.00.00.000000000 AM",
"modifiedname" : "Atul Bathla",
"modifiedname_keyword" : "Atul Bathla",
"peernames" : "Martin van Dijk| Ruchita Gandhi| Pravin Kadam| Atul Bathla| Sander Oudbier",
"bcpname" : "steve job",
"category" : "Clients",
"subcategory" : "General",
"createddate" : "30-MAR-19 12.00.00.000000000 AM",
"team" : "C&IB - Clearing",
"owner" : "C52948",
"id" : "365768",
"title" : "Vision Drilling",
"subcategory_keyword" : "General"
}
}
},
{
"_index" : "nfr_lcm_casedata_2019",
"_type" : "case",
"_id" : "366097",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2019-06-28T15:20:24.160Z",
"@version" : "1",
"case" : {
"peerid" : "366097",
"isconfidential" : "true",
"category_keyword" : "Clients",
"status" : "COMLETED",
"ownername" : "Sander Oudbier",
"team_keyword" : "C&IB - Clearing",
"type" : "CASE",
"closeddate" : "17-SEP-19 12.00.00.000000000 AM",
"ownername_keyword" : "Sander Oudbier",
"desc" : "Discussie over Nigeria",
"modifieddate" : "23-MAR-19 12.00.00.000000000 AM",
"modifiedname" : "Sander Oudbier",
"modifiedname_keyword" : "Sander Oudbier",
"peernames" : "Nick Laarhuis",
"bcpname" : "Karen",
"category" : "Clients",
"subcategory" : "General",
"createddate" : "01-APR-19 12.00.00.000000000 AM",
"team" : "C&IB - Clearing",
"owner" : "E62161",
"id" : "366097",
"title" : "1. Team Lending - Know How",
"subcategory_keyword" : "General"
}
}
},
But when i am using below query, it is not returning any results as per query

"query": {
"nested": {
"path": "case",
"query": {
"bool": {
"must": {
"multi_match": {
"query": "Clients",
"fields": [
"case.title^3",
"case.team",
"case.owner",
"case.ownername",
"case.desc",
"case.modifiedname",
"case.category",
"case.subcategory"
]
}
},
"filter": {
"term": {
"case.status": "INPROGRESS"
}
}
}
}
}
},
"_source": [
"case.id",
"case.title",
"case.team_keyword",
"case.ownername_keyword",
"case.desc",
"case.modifiedname_keyword",
"case.category_keyword",
"case.subcategory_keyword",
"case.bcpname",
"case.createddate",
"case.closeddate"
],
"sort": [
{
"case.createddate": {
"order": "desc"
}
}
],
"highlight": {
"fields": {
"case.title": {},
"case.desc": {}
}
}

please take your time to properly format your message. You can use markdown in here and you totally should, otherwise this is just unreadable JSON (that way the indendation stays in place). Thanks.

Also, please provide reproducible examples. This example is missing a mapping, index creation, document indexing but just contains snippets. This makes it impossible to reproduce it for others. Also specifying the Elasticsearch version, the JVM, your deployment always helps.

Third, you are using a nested query, despite that field not being an array. Why are you doing that?

--Alex

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