Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- POST users/user
- {
- "name" :"SMITH",
- "emails" : [
- "smith@gmail.com"
- ]
- }
- POST users/user
- {
- "name" :"SMITH",
- "emails" : [
- "mrsmith@gmail.com",
- "smith@gmail.com"
- ]
- }
- POST users/_search
- {
- "size": 0,
- "aggs": {
- "duplicateCount": {
- "terms": {
- "script": {
- "inline": "doc['emails.keyword'].value + '_' + doc['name.keyword'].value"
- }
- }
- }
- }
- }
- "aggregations": {
- "duplicateCount": {
- "doc_count_error_upper_bound": 0,
- "sum_other_doc_count": 0,
- "buckets": [
- {
- "key": "mrsmith@gmail.com_SMITH",
- "doc_count": 1
- },
- {
- "key": "smith@gmail.com_SMITH",
- "doc_count": 1
- }
- ]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement