Page MenuHomePhabricator
Paste P6390

(An Untitled Masterwork)
ActivePublic

Authored by Smalyshev on Nov 28 2017, 6:47 PM.
Tags
None
Referenced Files
F11053019:
Nov 28 2017, 6:47 PM
Subscribers
None
{
"description": "entity_full_text search for 'something'",
"path": "wikidatawiki_content\/page\/_search",
"params": {
"timeout": "20s",
"search_type": "dfs_query_then_fetch"
},
"query": {
"_source": [
"namespace",
"title",
"namespace_text",
"wiki",
"sitelink_count",
"statement_count",
"labels.en",
"descriptions.en"
],
"stored_fields": [],
"query": {
"bool": {
"disable_coord": true,
"should": [
{
"term": {
"title.keyword": "something"
}
},
{
"bool": {
"filter": [
{
"bool": {
"should": [
{
"match": {
"all": {
"query": "something",
"operator": "AND"
}
}
},
{
"match": {
"all.plain": {
"query": "something",
"operator": "AND"
}
}
},
{
"match": {
"descriptions.en": {
"query": "something",
"operator": "AND"
}
}
}
]
}
}
],
"should": [
{
"dis_max": {
"tie_breaker": 0,
"queries": [
{
"constant_score": {
"filter": {
"match": {
"labels.en.near_match": "something"
}
},
"boost": 2
}
},
{
"constant_score": {
"filter": {
"match": {
"labels.en.near_match_folded": "something"
}
},
"boost": 1.8
}
}
]
}
},
{
"bool": {
"should": [
{
"match": {
"all": {
"query": "something",
"operator": "OR",
"boost": 0.001
}
}
},
{
"match": {
"all.plain": {
"query": "something",
"operator": "OR",
"boost": 0.001
}
}
},
{
"dis_max": {
"tie_breaker": 1,
"queries": [
{
"match": {
"descriptions.en": {
"query": "something",
"boost": 1.8
}
}
},
{
"match": {
"labels.en.plain": {
"query": "something",
"boost": 1.8
}
}
},
{
"match": {
"descriptions.en.plain": {
"query": "something",
"boost": 0.001
}
}
}
]
}
}
]
}
}
]
}
}
],
"minimum_should_match": 1,
"filter": [
{
"terms": {
"namespace": [
0
]
}
}
]
}
},
"highlight": {
"pre_tags": [
"\ue000"
],
"post_tags": [
"\ue001"
],
"fields": {
"title": {
"type": "experimental",
"fragmenter": "none",
"number_of_fragments": 0,
"matched_fields": [
"title.keyword"
]
},
"labels.en.plain": {
"type": "experimental",
"fragmenter": "none",
"number_of_fragments": 0,
"options": {
"skip_if_last_matched": true
}
},
"descriptions.en.plain": {
"type": "experimental",
"fragmenter": "none",
"number_of_fragments": 0,
"options": {
"skip_if_last_matched": true
}
},
"labels.*.plain": {
"type": "experimental",
"fragmenter": "none",
"number_of_fragments": 0,
"options": {
"skip_if_last_matched": true
}
},
"descriptions.*.plain": {
"type": "experimental",
"fragmenter": "none",
"number_of_fragments": 0,
"options": {
"skip_if_last_matched": true
}
}
}
},
"size": 20,
"stats": [
"entity_full_text"
],
"rescore": [
{
"window_size": 8192,
"query": {
"query_weight": 1,
"rescore_query_weight": 1,
"score_mode": "total",
"rescore_query": {
"function_score": {
"score_mode": "sum",
"functions": [
{
"script_score": {
"script": {
"inline": "pow(doc['incoming_links'].value , 2) \/ ( pow(doc['incoming_links'].value, 2) + pow(50,2))",
"lang": "expression"
}
},
"weight": 0.6
},
{
"script_score": {
"script": {
"inline": "pow(doc['sitelink_count'].value , 2) \/ ( pow(doc['sitelink_count'].value, 2) + pow(20,2))",
"lang": "expression"
}
},
"weight": 0.4
}
]
}
}
}
}
]
},
"options": {
"timeout": "20s",
"search_type": "dfs_query_then_fetch"
}
}