Named Queries, inconsistent behaviour

Hi,
I am using elastic search 5.2.1 , I am seeing inconsistent behaviour in named queries, for some queries i am getting matched queries in response, while in certain queries i am not getting matched queries, some times i am getting matched queries in few records, and for few i am not getting. All these have been performed on the same index.

The query for which I got no matched queries is as follows

{
"query": {
"nested": {
"query" : {
"multi_match" : {
"query" : "production engineer",
"fields" : [
"company^1.0",
"keywordSet^5.0",
"qualification^2.0",
"rawJobColl.description^1.0",
"rawJobColl.metadataStr^5.0",
"rawJobColl.name^5.0"
],
"type" : "best_fields",
"operator" : "OR",
"slop" : 0,
"_name" : "production engineer"
}
},
"path" : "rawJobColl",
"score_mode" : "sum"
}
}
}

However if i run this query

{
"query" : {
"bool" : {
"must" : [
{
"function_score" : {
"query" : {
"nested" : {
"query" : {
"bool" : {
"should" : [
{
"multi_match" : {
"query" : "production engineer",
"fields" : [
"company^1.0",
"keywordSet^5.0",
"qualification^2.0",
"rawJobColl.description^1.0",
"rawJobColl.metadataStr^5.0",
"rawJobColl.name^5.0"
],
"type" : "best_fields",
"_name" : "production engineer"
}
}
]
}
},
"path" : "rawJobColl"
}
}
}
}
],
"filter" : [
{
"bool" : {
"must" : [
{
"nested" : {
"query" : {
"bool" : {
"must" : [
{
"terms" : {
"jobKeywords.keywordId" : [
32
],
"boost" : 1.0
}
}
]
}
},
"path" : "jobKeywords"
}
}
]
}
}
]
}
},
"_source" : {
"includes" : [
"id",
"name"
],
"excludes" : [ ]
}
}

I get matched queries, both of these queries are being run on the same index and type.

Please let me know what is going on?

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