Extension:CirrusSearch/Querying/Elasticsearch notes

Results: 12

Query:

Note: rescore omitted for brevity

 { "query": { "filtered": { "query": { "bool": { "minimum_number_should_match": 1, "should": [ {             "query_string": { "query": "functional programming ", "fields": [ "all.plain^1", "all^0.5" ],               "auto_generate_phrase_queries": true, "phrase_slop": 0, "default_operator": "AND", "allow_leading_wildcard": false, "fuzzy_prefix_length": 2, "rewrite": "top_terms_128" }           },            {              "multi_match": { "fields": [ "all_near_match^2" ],               "query": "functional programming " }           }          ]        }      },      "filter": { "bool": { "must": [ {             "query": { "query_string": { "query": "programming", "fields": [ "title" ],                 "default_operator": "AND", "allow_leading_wildcard": false, "fuzzy_prefix_length": 2, "rewrite": "top_terms_128" }             }            },            {              "query": { "query_string": { "query": "functional", "fields": [ "title" ],                 "default_operator": "AND", "allow_leading_wildcard": false, "fuzzy_prefix_length": 2, "rewrite": "top_terms_128" }             }            }          ]        }      }    }  } }

Results: 12

Query:

Note: rescore omitted for brevity

 { "query": { "filtered": { "query": { "bool": { "minimum_number_should_match": 1, "should": [ {             "query_string": { "query": "(title.plain:functiona*^20 OR redirect.title.plain:functiona*^15 OR category.plain:functiona*^8 OR heading.plain:functiona*^5 OR opening_text.plain:functiona*^3 OR text.plain:functiona*^1 OR auxiliary_text.plain:functiona*^0.5) programming ", "fields": [ "all.plain^1", "all^0.5" ],               "auto_generate_phrase_queries": true, "phrase_slop": 0, "default_operator": "AND", "allow_leading_wildcard": false, "fuzzy_prefix_length": 2, "rewrite": "top_terms_128" }           },            {              "multi_match": { "fields": [ "all_near_match^2" ],               "query": " programming " }           }          ]        }      },      "filter": { "bool": { "must": [ {             "query": { "query_string": { "query": "functiona*", "fields": [ "title" ],                 "default_operator": "AND", "allow_leading_wildcard": false, "fuzzy_prefix_length": 2, "rewrite": "top_terms_128" }             }            },            {              "query": { "query_string": { "query": "programming", "fields": [ "title" ],                 "default_operator": "AND", "allow_leading_wildcard": false, "fuzzy_prefix_length": 2, "rewrite": "top_terms_128" }             }            }          ]        }      }    }  } }

Results: (none)

Query:

Note: rescore omitted for brevity

 { "query": { "filtered": { "query": { "bool": { "minimum_number_should_match": 1, "should": [ {             "query_string": { "query": "functional (title.plain:programmin*^20 OR redirect.title.plain:programmin*^15 OR category.plain:programmin*^8 OR heading.plain:programmin*^5 OR opening_text.plain:programmin*^3 OR text.plain:programmin*^1 OR auxiliary_text.plain:programmin*^0.5) ", "fields": [ "all.plain^1", "all^0.5" ],               "auto_generate_phrase_queries": true, "phrase_slop": 0, "default_operator": "AND", "allow_leading_wildcard": false, "fuzzy_prefix_length": 2, "rewrite": "top_terms_128" }           },            {              "multi_match": { "fields": [ "all_near_match^2" ],               "query": "functional " }           }          ]        }      },      "filter": { "bool": { "must": [ {             "query": { "query_string": { "query": "functional", "fields": [ "title" ],                 "default_operator": "AND", "allow_leading_wildcard": false, "fuzzy_prefix_length": 2, "rewrite": "top_terms_128" }             }            },            {              "query": { "query_string": { "query": "programmin*", "fields": [ "title" ],                 "default_operator": "AND", "allow_leading_wildcard": false, "fuzzy_prefix_length": 2, "rewrite": "top_terms_128" }             }            }          ]        }      }    }  } }

Without
If we drop the  field, we get some results:


 * Esoteric programming language
 * Infobox programming language
 * Object-oriented programming
 * (and so on)

These are all missing functional in the title.