Facebook
From Gray Coyote, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 68
  1. {
  2.     "from": 0,
  3.     "size": 24,
  4.     "query": {
  5.         "function_score": {
  6.             "boost_mode": "replace",
  7.             "functions": [
  8.                 {
  9.                     "script_score": {
  10.                         "params": {
  11.                             "factor": 1.1,
  12.                             "now": 1596725731
  13.                         },
  14.                         "script": [
  15.                             "factor * (1 + (10-log(1 + 0.00024 * abs(now - doc['__updated_at'].value))))"
  16.                         ]
  17.                     }
  18.                 },
  19.                 {
  20.                     "script_score": {
  21.                         "params": {
  22.                             "factor": 1.2
  23.                         },
  24.                         "script": [
  25.                             "factor * log(1 + 0.06 * doc['price'].value)"
  26.                         ]
  27.                     }
  28.                 },
  29.                 {
  30.                     "script_score": {
  31.                         "params": {
  32.                             "factor": 1.05
  33.                         },
  34.                         "script": [
  35.                             "factor * (10 - log(1 + 37 * doc['ship_price'].value))"
  36.                         ]
  37.                     }
  38.                 },
  39.                 {
  40.                     "script_score": {
  41.                         "params": {
  42.                             "factor": 1.2
  43.                         },
  44.                         "script": [
  45.                             "factor * log(1 + 25 * doc['sell_count'].value)"
  46.                         ]
  47.                     }
  48.                 },
  49.                 {
  50.                     "script_score": {
  51.                         "params": {
  52.                             "factor": 1.2
  53.                         },
  54.                         "script": [
  55.                             "factor * log(1 + 0.001 * doc['stock'].value)"
  56.                         ]
  57.                     }
  58.                 },
  59.                 {
  60.                     "script_score": {
  61.                         "params": {
  62.                             "factor": 2
  63.                         },
  64.                         "script": [
  65.                             "factor * doc['discount'].value / 10"
  66.                         ]
  67.                     }
  68.                 },
  69.                 {
  70.                     "script_score": {
  71.                         "script": [
  72.                             "-1 * (1000 * sqrt(doc['evo_category.id'].value))"
  73.                         ]
  74.                     }
  75.                 },
  76.                 {
  77.                     "script_score": {
  78.                         "script": [
  79.                             "_score"
  80.                         ]
  81.                     }
  82.                 }
  83.             ],
  84.             "query": {
  85.                 "filtered": {
  86.                     "filter": {
  87.                         "bool": {
  88.                             "must": [
  89.                                 {
  90.                                     "term": {
  91.                                         "shop_active": true
  92.                                     }
  93.                                 },
  94.                                 {
  95.                                     "term": {
  96.                                         "active": true
  97.                                     }
  98.                                 },
  99.                                 {
  100.                                     "range": {
  101.                                         "price": {
  102.                                             "from": 0.99
  103.                                         }
  104.                                     }
  105.                                 },
  106.                                 {
  107.                                     "range": {
  108.                                         "stock": {
  109.                                             "from": 1
  110.                                         }
  111.                                     }
  112.                                 },
  113.                                 {
  114.                                     "range": {
  115.                                         "evo_category.id": {
  116.                                             "gt": 0
  117.                                         }
  118.                                     }
  119.                                 }
  120.                             ],
  121.                             "must_not": [
  122.                                 {
  123.                                     "term": {
  124.                                         "image_passive": true
  125.                                     }
  126.                                 }
  127.                             ]
  128.                         }
  129.                     },
  130.                     "query": {
  131.                         "bool": {
  132.                             "should": [
  133.                                 {
  134.                                     "match": {
  135.                                         "name": "mayk ayakkabı"
  136.                                     }
  137.                                 }
  138.                             ],
  139.                             "minimum_should_match": "100%"
  140.                         }
  141.                     }
  142.                 }
  143.             },
  144.             "score_mode": "avg"
  145.         }
  146.     },
  147.     "sort": [
  148.         {
  149.             "_score": {
  150.                 "order": "desc"
  151.             }
  152.         }
  153.     ],
  154.     "aggs": {
  155.         "attributes": {
  156.             "aggs": {
  157.                 "attribute_values": {
  158.                     "terms": {
  159.                         "field": "evo_attributes.values.key_value"
  160.                     }
  161.                 }
  162.             },
  163.             "terms": {
  164.                 "field": "evo_attributes.key_value"
  165.             }
  166.         },
  167.         "category": {
  168.             "terms": {
  169.                 "order": {
  170.                     "_term": "asc"
  171.                 },
  172.                 "script": "doc['evo_category.breadcrumb_url_text'].value + '||' + doc['evo_category.breadcrumb_text'].value",
  173.                 "size": 500
  174.             }
  175.         }
  176.     }
  177. }

Replies to Untitled rss

Title Name Language When
Re: Untitled Flying Guinea Pig text 3 Years ago.