CopyPastor

Detecting plagiarism made easy.

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

Possible Plagiarism

Plagiarized on 2019-07-15
by Nishant Saini

Original Post

Original - Posted on 2017-11-12
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" } } } ] } } }
You don't need to add `query` around the `multi_match` constraint:
{ "from": 0, "size": 1000, "query": { "bool": { "must": [ { "multi_match": { "query": "shampoo", "fields": [ "summary.exact", "promotionid.basic" ], "type": "cross_fields", "minimum_should_match": "100%" } }, { "bool": { "should": [ { "term": { "is_non_ecomm": "1" } } ], "must": [ { "term": { "iscouponactive": "1" } } ] } } ] } } }

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