Page MenuHomePhabricator
Paste P10307

separate morelike for two pages
ActivePublic

Authored by EBernhardson on Tue, Feb 4, 8:35 PM.
{
"_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"
}
]
}
},
{
"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": "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
}
]
}
}
}
}
]
}