Page MenuHomePhabricator
Paste P10309

maximum of sigmoid of two separate morelikethis queries
ActivePublic

Authored by EBernhardson on Feb 4 2020, 9:00 PM.
Tags
None
Referenced Files
F31547857: raw.txt
Feb 4 2020, 9:04 PM
F31547854: raw.txt
Feb 4 2020, 9:00 PM
Subscribers
None
{
"_source": [
"namespace_text",
"title"
],
"size": 3,
"query": {
"bool": {
"must": [
{
"dis_max": {
"queries": [
{
"function_score": {
"boost_mode": "replace",
"query": {
"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"
}
]
}
},
"functions": [
{
"script_score": {
"script": {
"params": {
"a": 5,
"m": 10
},
"source": "Math.pow(_score, params.a) / (Math.pow(_score, params.a) + Math.pow(params.m, params.a))"
}
}
}
]
}
},
{
"function_score": {
"boost_mode": "replace",
"query": {
"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"
}
]
}
},
"functions": [
{
"script_score": {
"script": {
"params": {
"a": 5,
"m": 10
},
"source": "Math.pow(_score, params.a) / (Math.pow(_score, params.a) + Math.pow(params.m, params.a))"
}
}
}
]
}
}
]
}
}
],
"filter": [
{
"terms": {
"namespace": [
0
]
}
}
]
}
}
}