Guest User

boosting-query.json

a guest
Jun 27th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.72 KB | None | 0 0
  1. {
  2.   "query": {
  3.     "boosting": {
  4.       "positive": {
  5.         "bool": {
  6.           "filter": [
  7.             {
  8.               "term": {
  9.                 "state": 1
  10.               }
  11.             },
  12.             {
  13.               "term": {
  14.                 "cat_state": 1
  15.               }
  16.             },
  17.             {
  18.               "bool": {
  19.                 "should": [
  20.                   {
  21.                     "range": {
  22.                       "end_date": {
  23.                         "gte": "2019-06-26+17:42:52"
  24.                       }
  25.                     }
  26.                   },
  27.                   {
  28.                     "term": {
  29.                       "end_date": "0"
  30.                     }
  31.                   },
  32.                   {
  33.                     "bool": {
  34.                       "must_not": [
  35.                         {
  36.                           "exists": {
  37.                             "field": "end_date"
  38.                           }
  39.                         }
  40.                       ]
  41.                     }
  42.                   }
  43.                 ]
  44.               }
  45.             },
  46.             {
  47.               "bool": {
  48.                 "should": [
  49.                   {
  50.                     "range": {
  51.                       "publish_end_date": {
  52.                         "gte": "2019-06-26+17:42:52"
  53.                       }
  54.                     }
  55.                   },
  56.                   {
  57.                     "term": {
  58.                       "publish_end_date": "0"
  59.                     }
  60.                   },
  61.                   {
  62.                     "bool": {
  63.                       "must_not": [
  64.                         {
  65.                           "exists": {
  66.                             "field": "publish_end_date"
  67.                           }
  68.                         }
  69.                       ]
  70.                     }
  71.                   }
  72.                 ]
  73.               }
  74.             }
  75.           ],
  76.           "should": [
  77.             {
  78.               "match": {
  79.                 "title": {
  80.                   "query": "dna",
  81.                   "operator": "and",
  82.                   "boost": 1.7
  83.                 }
  84.               }
  85.             },
  86.             {
  87.               "match": {
  88.                 "description": {
  89.                   "query": "dna",
  90.                   "operator": "and",
  91.                   "boost": 0.7
  92.                 }
  93.               }
  94.             }
  95.           ],
  96.           "minimum_should_match": 1,
  97.           "must_not": []
  98.         }
  99.       },
  100.       "negative": {
  101.         "terms": {
  102.           "_index": [
  103.             "index_a",
  104.             "index_c",
  105.             "index_d",
  106.             "index_e",
  107.             "index_f"
  108.           ]
  109.         }
  110.       },
  111.       "negative_boost": 0.5
  112.     }
  113.   }
  114. }
Advertisement
Add Comment
Please, Sign In to add comment