Page MenuHomePhabricator
Paste P9524

(An Untitled Masterwork)
ActivePublic

Authored by EBernhardson on Mon, Nov 4, 7:30 PM.
{
"_source": [ "title" ],
"explain": true,
"size": 1,
"query": {
"bool": {
"filter": [
{
"bool": {
"should": [
{
"match": {
"all": {
"query": "example",
"operator": "AND"
}
}
},
{
"match": {
"all.plain": {
"query": "example",
"operator": "AND"
}
}
}
]
}
},
{
"terms": {
"namespace": [
0
]
}
}
]
}
},
"rescore": [
{
"window_size": 1024,
"query": {
"query_weight": 1,
"rescore_query_weight": 1,
"score_mode": "total",
"rescore_query": {
"function_score": {
"score_mode": "sum",
"boost_mode": "sum",
"query": {
"sltr": {
"model": "20170911_enwiki_v1",
"params": {
"query_string": "example"
}
}
},
"functions": [
{
"script_score": {
"script": {
"lang": "painless",
"source": """
double popularity = doc['popularity_score'].empty ? 0 : doc['popularity_score'].value;
double norm_ltr = (_score - params.mean) / params.std;
return popularity * params.w1 + norm_ltr * params.w2;
""",
"params": {
"mean": 1.2,
"std": 0.42,
"w1": 0.8,
"w2": 0.2
}
}
}
}
]
}
}
}
}
]
}

Event Timeline