24 ms | Path : /goafrica_ads/_search Method : POST {
"query": {
"function_score": {
"query": {
"bool": {
"filter": {
"bool": {
"must": [
{
"term": {
"has_background": true
}
},
{
"term": {
"enabled": true
}
},
{
"bool": {
"must": [
{
"range": {
"start_date": {
"lte": "2025-08-04T13:14:43.319Z"
}
}
},
{
"range": {
"end_date": {
"gte": "2025-08-04T13:14:43.319Z"
}
}
}
]
}
},
{
"bool": {
"minimum_should_match": 1,
"should": [
{
"term": {
"country": {
"value": "ma",
"case_insensitive": true
}
}
},
{
"term": {
"all_countries": true
}
}
]
}
},
{
"term": {
"background_on_homepage": true
}
},
{
"script": {
"script": {
"source": "doc['hour_nb_views'].value < (\n ((((new Date()).getTime() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60)) <= (((doc['end_date'].value.toInstant().toEpochMilli() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60)) * 0.80))\n ? Math.ceil(((((Math.floor((((new Date()).getTime() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60))) + 1) * ((doc['max_views'].value * 0.90) / (((doc['end_date'].value.toInstant().toEpochMilli() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60)) * 0.80))) - doc['nb_views'].value) <= 0 ? 0 : (((Math.floor((((new Date()).getTime() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60))) + 1) * ((doc['max_views'].value * 0.90) / (((doc['end_date'].value.toInstant().toEpochMilli() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60)) * 0.80))) - doc['nb_views'].value)))\n : Math.ceil(((doc['max_views'].value - doc['nb_views'].value) / ((doc['end_date'].value.toInstant().toEpochMilli() - (new Date()).getTime()) / (1000 * 60 * 60))))\n )"
}
}
}
]
}
}
}
},
"functions": [
{
"script_score": {
"script": {
"source": "(doc['max_views'].value - doc['nb_views'].value) / (doc['end_date'].value.toInstant().toEpochMilli() - (new Date().getTime()))"
}
}
},
{
"field_value_factor": {
"field": "weight"
}
},
{
"random_score": {}
}
]
}
},
"size": 1,
"from": 0
} |
---|
28 ms | Path : /goafrica_ads/_search Method : POST {
"query": {
"function_score": {
"query": {
"bool": {
"filter": {
"bool": {
"must": [
{
"term": {
"has_background": true
}
},
{
"term": {
"enabled": true
}
},
{
"bool": {
"must": [
{
"range": {
"start_date": {
"lte": "2025-08-04T13:14:43.350Z"
}
}
},
{
"range": {
"end_date": {
"gte": "2025-08-04T13:14:43.350Z"
}
}
}
]
}
},
{
"bool": {
"minimum_should_match": 1,
"should": [
{
"term": {
"country": {
"value": "ma",
"case_insensitive": true
}
}
},
{
"term": {
"all_countries": true
}
}
]
}
},
{
"term": {
"background_on_homepage": true
}
},
{
"script": {
"script": {
"source": "doc['hour_nb_views'].value < (\n ((((new Date()).getTime() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60)) <= (((doc['end_date'].value.toInstant().toEpochMilli() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60)) * 0.80))\n ? Math.ceil(((((Math.floor((((new Date()).getTime() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60))) + 1) * ((doc['max_views'].value * 0.90) / (((doc['end_date'].value.toInstant().toEpochMilli() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60)) * 0.80))) - doc['nb_views'].value) <= 0 ? 0 : (((Math.floor((((new Date()).getTime() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60))) + 1) * ((doc['max_views'].value * 0.90) / (((doc['end_date'].value.toInstant().toEpochMilli() - doc['start_date'].value.toInstant().toEpochMilli()) / (1000 * 60 * 60)) * 0.80))) - doc['nb_views'].value)))\n : Math.ceil(((doc['max_views'].value - doc['nb_views'].value) / ((doc['end_date'].value.toInstant().toEpochMilli() - (new Date()).getTime()) / (1000 * 60 * 60))))\n )"
}
}
}
]
}
}
}
},
"functions": [
{
"script_score": {
"script": {
"source": "(doc['max_views'].value - doc['nb_views'].value) / (doc['end_date'].value.toInstant().toEpochMilli() - (new Date().getTime()))"
}
}
},
{
"field_value_factor": {
"field": "weight"
}
},
{
"random_score": {}
}
]
}
},
"size": 1,
"from": 0
} |
---|
11 ms | Path : /goafrica_ads/_search Method : POST {
"query": {
"function_score": {
"query": {
"bool": {
"filter": {
"bool": {
"must": [
{
"term": {
"has_background": true
}
},
{
"term": {
"enabled": true
}
},
{
"bool": {
"must": [
{
"range": {
"start_date": {
"lte": "2025-08-04T13:14:43.378Z"
}
}
},
{
"range": {
"end_date": {
"gte": "2025-08-04T13:14:43.378Z"
}
}
}
]
}
},
{
"bool": {
"minimum_should_match": 1,
"should": [
{
"term": {
"country": {
"value": "ma",
"case_insensitive": true
}
}
},
{
"term": {
"all_countries": true
}
}
]
}
},
{
"term": {
"background_on_homepage": true
}
}
]
}
}
}
},
"functions": [
{
"script_score": {
"script": {
"source": "(doc['max_views'].value - doc['nb_views'].value) / (doc['end_date'].value.toInstant().toEpochMilli() - (new Date().getTime()))"
}
}
},
{
"field_value_factor": {
"field": "weight"
}
},
{
"random_score": {}
}
]
}
},
"size": 1,
"from": 0
} |
---|
5 ms | Path : /goafrica_ads/_search Method : POST {
"query": {
"function_score": {
"query": {
"bool": {
"filter": {
"bool": {
"must": [
{
"term": {
"has_background": true
}
},
{
"term": {
"enabled": true
}
},
{
"bool": {
"must": [
{
"range": {
"start_date": {
"lte": "2025-08-04T13:14:43.390Z"
}
}
},
{
"range": {
"end_date": {
"gte": "2025-08-04T13:14:43.390Z"
}
}
}
]
}
},
{
"bool": {
"minimum_should_match": 1,
"should": [
{
"term": {
"country": {
"value": "ma",
"case_insensitive": true
}
}
},
{
"term": {
"all_countries": true
}
}
]
}
},
{
"term": {
"background_on_homepage": true
}
}
]
}
}
}
},
"functions": [
{
"script_score": {
"script": {
"source": "(doc['max_views'].value - doc['nb_views'].value) / (doc['end_date'].value.toInstant().toEpochMilli() - (new Date().getTime()))"
}
}
},
{
"field_value_factor": {
"field": "weight"
}
},
{
"random_score": {}
}
]
}
},
"size": 1,
"from": 0
} |
---|