CopyPastor

Detecting plagiarism made easy.

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

Possible Plagiarism

Plagiarized on 2019-09-08
by shiredude95

Original Post

Original - Posted on 2017-11-08
by mickl



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

If you only want to eliminate `d` from your search, this can be easily done by adding a `must_not` leaf to your `compound-query`.
{ "query": { "constant_score": { "filter": { "bool": { "must": { "match": { "content": { "query": "a b c", "operator": "and" } } }, "must_not": { "match": { "content": "d" } } } } } } }
`constant-score` improves performance by caching the results Results
"hits": { "total": { "value": 2, "relation": "eq" }, "max_score": 1.0, "hits": [ { ... "_score": 1.0, "_source": { "content": "a b c" } }, { ... "_score": 1.0, "_source": { "content": "a b c f" } } ] }
Try to use **keyword** instead of **text** in your mapping like:
{ "mappings": { "your_type_name": { "properties": { "metadata" : { "type" : "nested", "properties" : { "name" : { "type" : "keyword" }, "value" : { "type" :"keyword" } } } } } } } These fields won't be analyzed. Then you should reindex your data and to query your data you should replace match (which is analyzed query) with **term**.
{ "query": { "bool": { "must": [ { "nested": { "path": "metadata", "query": { "bool": { "must": [ { "term": { "metadata.name": "number" } }, { "term": { "metadata.value": "2014.NWJSD.47" } } ] } } } } ] } } }



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