scherepanov

Untitled

Jan 4th, 2020
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 1.21 KB | None | 0 0
  1. {
  2.     "_source": [
  3.         "identifier",
  4.         "document_type"
  5.     ],
  6.     "aggs":{  
  7.       "myaggs":{  
  8.          "terms":{  
  9.             "script":{  
  10.                "source":"doc['values.colors-reference_data_options.<all_channels>.<all_locales>']"
  11.                
  12.             }
  13.          }
  14.       }
  15.    },
  16.     "query": {
  17.         "constant_score": {
  18.             "filter": {
  19.                 "bool": {
  20.                     "filter": [
  21.                         {
  22.                             "exists": {
  23.                                 "field": "values.colors-reference_data_options.<all_channels>.<all_locales>"
  24.                             }
  25.                         },
  26.                         {
  27.                             "script": {
  28.                                 "script": {
  29.                                     "source": "doc['values.colors-reference_data_options.<all_channels>.<all_locales>'].contains('redchilli')",
  30.                                     "lang": "painless"
  31.                                 }
  32.                             }
  33.                         }
  34.                     ]
  35.                 }
  36.             }
  37.         }
  38.     },
  39.     "size": 100,
  40.     "sort": {
  41.         "_uid": "asc"
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment