Last active
November 13, 2017 21:44
-
-
Save smalyshev/e2a5d213cd0b85773f632f03a973cd18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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.de", | |
| "descriptions.de", | |
| "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.de": { | |
| "query": "something", | |
| "operator": "AND" | |
| } | |
| } | |
| }, | |
| { | |
| "match": { | |
| "descriptions.en": { | |
| "query": "something", | |
| "operator": "AND" | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "should": [ | |
| { | |
| "dis_max": { | |
| "tie_breaker": 0, | |
| "queries": [ | |
| { | |
| "constant_score": { | |
| "filter": { | |
| "match": { | |
| "labels.de.near_match": "something" | |
| } | |
| }, | |
| "boost": 2 | |
| } | |
| }, | |
| { | |
| "constant_score": { | |
| "filter": { | |
| "match": { | |
| "labels.de.near_match_folded": "something" | |
| } | |
| }, | |
| "boost": 1.8 | |
| } | |
| }, | |
| { | |
| "constant_score": { | |
| "filter": { | |
| "match": { | |
| "labels.en.near_match": "something" | |
| } | |
| }, | |
| "boost": 0.1 | |
| } | |
| }, | |
| { | |
| "constant_score": { | |
| "filter": { | |
| "match": { | |
| "labels.en.near_match_folded": "something" | |
| } | |
| }, | |
| "boost": 0.09 | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "bool": { | |
| "should": [ | |
| { | |
| "match": { | |
| "all": { | |
| "query": "something", | |
| "operator": "OR", | |
| "boost": 0.001 | |
| } | |
| } | |
| }, | |
| { | |
| "match": { | |
| "all.plain": { | |
| "query": "something", | |
| "operator": "OR", | |
| "boost": 0.001 | |
| } | |
| } | |
| }, | |
| { | |
| "dis_max": { | |
| "queries": [ | |
| { | |
| "match": { | |
| "descriptions.de": { | |
| "query": "something", | |
| "boost": 1.8 | |
| } | |
| } | |
| }, | |
| { | |
| "match": { | |
| "labels.de.plain": { | |
| "query": "something", | |
| "boost": 1.8 | |
| } | |
| } | |
| }, | |
| { | |
| "match": { | |
| "descriptions.de.plain": { | |
| "query": "something", | |
| "boost": 0.001 | |
| } | |
| } | |
| }, | |
| { | |
| "match": { | |
| "labels.en.plain": { | |
| "query": "something", | |
| "boost": 0.09 | |
| } | |
| } | |
| }, | |
| { | |
| "match": { | |
| "descriptions.en": { | |
| "query": "something", | |
| "boost": 0.09 | |
| } | |
| } | |
| }, | |
| { | |
| "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.de.plain": { | |
| "type": "experimental", | |
| "fragmenter": "none", | |
| "number_of_fragments": 0, | |
| "options": { | |
| "skip_if_last_matched": true | |
| } | |
| }, | |
| "descriptions.de.plain": { | |
| "type": "experimental", | |
| "fragmenter": "none", | |
| "number_of_fragments": 0, | |
| "options": { | |
| "skip_if_last_matched": true | |
| } | |
| }, | |
| "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" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment