Skip to content

Instantly share code, notes, and snippets.

@tlovett1
Created November 17, 2017 18:29
Show Gist options
  • Save tlovett1/95185fd7e35f9f875e7e3a06c177c076 to your computer and use it in GitHub Desktop.
Save tlovett1/95185fd7e35f9f875e7e3a06c177c076 to your computer and use it in GitHub Desktop.
{
"from": 0,
"size": 20,
"sort": [
{
"_score": {
"order": "desc"
}
}
],
"query": {
"function_score": {
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "Haskell Santos",
"fields": [
"authors"
],
"boost": 5
}
}
],
"should": [
{
"multi_match": {
"query": "Haskell Santos",
"type": "phrase",
"fields": [
"post_title",
"post_excerpt",
"post_content",
"post_meta.msr_speaker",
"post_meta.msr_other_speaker",
"post_meta.msr_other_author",
"post_meta.msr_longbiography",
"post_meta.msr_host",
"post_meta.tab_content",
"post_meta.msr_speaker.no_diacritics",
"post_meta.msr_other_speaker.no_diacritics",
"post_meta.msr_author.no_diacritics",
"post_meta.msr_other_author.no_diacritics",
"post_meta.msr_longbiography.no_diacritics",
"post_meta.msr_host.no_diacritics",
"post_meta.tab_content.no_diacritics"
],
"boost": 10
}
},
{
"multi_match": {
"query": "Haskell Santos",
"fields": [
"post_title",
"post_excerpt",
"post_content",
"post_meta.msr_speaker",
"post_meta.msr_other_speaker",
"post_meta.msr_other_author",
"post_meta.msr_longbiography",
"post_meta.msr_host",
"post_meta.tab_content",
"post_meta.msr_speaker.no_diacritics",
"post_meta.msr_other_speaker.no_diacritics",
"post_meta.msr_author.no_diacritics",
"post_meta.msr_other_author.no_diacritics",
"post_meta.msr_longbiography.no_diacritics",
"post_meta.msr_host.no_diacritics",
"post_meta.tab_content.no_diacritics"
],
"boost": 5,
"type": "cross_fields",
"analyzer": "standard"
}
}
]
}
},
"exp": {
"post_date_gmt": {
"scale": "14d",
"decay": 0.25,
"offset": "7d"
}
},
"score_mode": "avg",
"boost_mode": "sum"
}
},
"post_filter": {
"bool": {
"must": [
{
"term": {
"post_type.raw": "msr-research-item"
}
},
{
"terms": {
"post_status": [
"publish",
"future",
"draft",
"pending",
"private"
]
}
}
]
}
},
"rescore": {
"window_size": 500,
"query": {
"rescore_query": {
"match": {
"post_title": {
"query": "Haskell Santos",
"type": "phrase",
"slop": 2
}
}
},
"query_weight": 0.69999999999999996,
"rescore_query_weight": 10
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment