Page MenuHomePhabricator
Paste P10306

Simple morelike query for two pages
ActivePublic

Authored by EBernhardson on Feb 4 2020, 8:17 PM.
Tags
None
Referenced Files
F31547804: raw.txt
Feb 4 2020, 8:29 PM
F31547776: raw.txt
Feb 4 2020, 8:17 PM
Subscribers
None
{
"_source": [
"namespace_text",
"title"
],
"size": 3,
"query": {
"bool": {
"must": [
{
"more_like_this": {
"min_doc_freq": 2,
"max_doc_freq": null,
"max_query_terms": 25,
"min_term_freq": 2,
"min_word_length": 0,
"max_word_length": 0,
"minimum_should_match": "30%",
"fields": [
"text"
],
"like": [
{
"_id": "752"
},
{
"_id": "22939"
}
]
}
}
],
"filter": [
{
"terms": {
"namespace": [
0
]
}
}
]
}
},
"rescore": [
{
"window_size": 8192,
"query": {
"query_weight": 1,
"rescore_query_weight": 1,
"score_mode": "total",
"rescore_query": {
"function_score": {
"score_mode": "sum",
"boost_mode": "sum",
"functions": [
{
"script_score": {
"script": {
"source": "pow(doc['popularity_score'].value , 0.8) \/ ( pow(doc['popularity_score'].value, 0.8) + pow(8.0E-6,0.8))",
"lang": "expression"
}
},
"weight": 3
},
{
"script_score": {
"script": {
"source": "pow(doc['incoming_links'].value , 0.7) \/ ( pow(doc['incoming_links'].value, 0.7) + pow(30,0.7))",
"lang": "expression"
}
},
"weight": 10
}
]
}
}
}
}
]
}

Event Timeline

EBernhardson changed the title of this paste from Simple morelike query for single page id to Simple morelike query for two pages.Feb 4 2020, 8:29 PM
EBernhardson edited the content of this paste. (Show Details)