CopyPastor

Detecting plagiarism made easy.

Score: 0.8259938444733507; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-07-15
by Nishant Saini

Original Post

Original - Posted on 2017-09-01
by Val



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Your query is malformed. You are using two queries here `nested` and `bool`. Both these queries must be wrapped in either `must`, `should` or `filter` of a bool query. Assuming both the condition are necessary for a match, both these queries should be wrapped in either `must` or `filter` clause of a `bool` query as below:
{ "query": { "bool": { "must": [ { "nested": { "path": "metadata", "query": { "bool": { "should": [ { "match": { "metadata.deleted": true } } ] } } } }, { "must": { "term": { "on_behalf_of": "b71457f731d8a6f" } } } ] } } }
Your second `must` clause is not properly located, it must be inside the existing `bool/must` query. You need to rewrite your query to this:
{ "from":0, "size":15, "query":{ "bool":{ "must":[ { "multi_match":{ "query":"books", "fields":[ "title^20", "lead^10", "content" ], "type":"phrase" } }, { "match":{ "groupid": "599e4b49239cfa0a5a5f189d" } } ] } }, "sort":[ { "times":{ "order":"desc" } } ] }

        
Present in both answers; Present only in the new answer; Present only in the old answer;