{
    "bool": {
        "must": [
            {
                "bool": {
                    "should": [
                        {
                            "multi_match": {
                                "query": "some search term",
                                "fields": [
                                    "all_near_match^5",
                                    "all_near_match.asciifolding^3.75"
                                ]
                            }
                        },
                        {
                            "bool": {
                                "minimum_should_match": 1,
                                "should": [
                                    {
                                        "dis_max": {
                                            "tie_breaker": 1,
                                            "queries": [
                                                {
                                                    "bool": {
                                                        "minimum_should_match": 0,
                                                        "filter": [
                                                            {
                                                                "multi_match": {
                                                                    "query": "some search term",
                                                                    "fields": [
                                                                        "all",
                                                                        "all.plain"
                                                                    ],
                                                                    "operator": "and"
                                                                }
                                                            }
                                                        ],
                                                        "should": [
                                                            {
                                                                "match": {
                                                                    "title": {
                                                                        "query": "some search term",
                                                                        "boost": 9
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "bool": {
                                            "minimum_should_match": 1,
                                            "should": [
                                                {
                                                    "match": {
                                                        "weighted_tags": {
                                                            "query": "image.linked.from.wikidata.p18\/Q1",
                                                            "boost": 10
                                                        }
                                                    }
                                                },
                                                {
                                                    "match": {
                                                        "weighted_tags": {
                                                            "query": "image.linked.from.wikidata.p373\/Q1",
                                                            "boost": 20
                                                        }
                                                    }
                                                },
                                                {
                                                    "match": {
                                                        "weighted_tags": {
                                                            "query": "image.linked.from.wikidata.sitelink\/Q1",
                                                            "boost": 30
                                                        }
                                                    }
                                                },
                                                {
                                                    "match": {
                                                        "weighted_tags": {
                                                            "query": "image.linked.from.wikidata.p18\/Q2",
                                                            "boost": 5
                                                        }
                                                    }
                                                },
                                                {
                                                    "match": {
                                                        "weighted_tags": {
                                                            "query": "image.linked.from.wikidata.p373\/Q2",
                                                            "boost": 10
                                                        }
                                                    }
                                                },
                                                {
                                                    "match": {
                                                        "weighted_tags": {
                                                            "query": "image.linked.from.wikidata.sitelink\/Q2",
                                                            "boost": 15
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ],
                    "minimum_should_match": 1
                }
            }
        ],
        "filter": [
            {
                "terms": {
                    "namespace": [
                        0
                    ]
                }
            }
        ]
    }
}