Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "query": {
- "bool": {
- "must": {
- "function_score": {
- "query": {
- "function_score": {
- "query": {
- "bool": {
- "should": [
- {
- "match_all": {}
- },
- {
- "match": {
- "name": {
- "query": "Очищающее средство против морщин для сухой и жирной кожи, VENZEN Soft Cream Hydrating Nicotinamide Essence, 50",
- "boost": 5,
- "minimum_should_match": "60%"
- }
- }
- }
- ]
- }
- },
- "functions": [
- {
- "filter": {
- "range": {
- "price.local": {
- "gte": 92.0,
- "lte": 138.0
- }
- }
- },
- "weight": 1.4
- }
- ]
- }
- },
- "functions": [
- {
- "filter": {
- "bool": {
- "must_not": {
- "range": {
- "adv_cpa_sort_price": {
- "gt": 0
- }
- }
- },
- "should": [
- {
- "range": {
- "adv_prices.others": {
- "gt": 0
- }
- }
- },
- {
- "range": {
- "adv_prices.catalog": {
- "gt": 0
- }
- }
- }
- ]
- }
- },
- "weight": 10,
- "script_score": {
- "script": {
- "lang": "painless",
- "inline": "Math.log1p(doc[params.adv_field_others].value)",
- "params": {
- "adv_field_others": "adv_prices.others",
- "adv_field_catalog": "adv_prices.catalog"
- }
- }
- }
- },
- {
- "filter": {
- "range": {
- "adv_cpa_sort_price": {
- "gt": 0
- }
- }
- },
- "weight": 10,
- "script_score": {
- "script": {
- "lang": "painless",
- "inline": "\n Math.log1p(\n doc[params.cpa_field].value >= params.min_price\n ? doc[params.cpa_field].value\n : params.min_price\n )\n ",
- "params": {
- "cpa_field": "adv_cpa_sort_price",
- "min_price": 0.11
- }
- }
- }
- }
- ],
- "score_mode": "sum",
- "boost_mode": "sum"
- }
- },
- "filter": [
- {
- "bool": {
- "must_not": [
- {
- "ids": {
- "values": [
- "product~1403193805"
- ]
- }
- }
- ]
- }
- },
- {
- "bool": {
- "must_not": [
- {
- "term": {
- "company.id": 2418473
- }
- }
- ]
- }
- },
- {
- "term": {
- "category.id": 330606
- }
- },
- {
- "bool": {
- "must": [
- {
- "term": {
- "company.status": 0
- }
- }
- ],
- "must_not": [
- {
- "term": {
- "company.holidays": datetime.date(2022,7,26)
- }
- }
- ]
- }
- },
- {
- "terms": {
- "_doc_type_join": [
- "product"
- ]
- }
- }
- ]
- }
- },
- "_source": False,
- "size": 10,
- "from": 0,
- "rescore": [
- {
- "grouping_mixup": {
- "group_field": "company.id",
- "decline_script": {
- "inline": "7.0 / (7.0 * params._pos + 10.0) + 0.3",
- "lang": "painless"
- }
- },
- "window_size": 1000
- }
- ],
- "docvalue_fields": [
- "_doc_type_join",
- "_doc_type_join#*"
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement