Hello, just wondering how I can implement match phrase (on multiple fields) and multi_match together. I have a basic query going, but I am not able to figure out phrase match on multiple fields. I want results return in following order:
- Exact phrase match (word sequence matter with some slop)
- All words in query matched with AND (words sequence does not matter)
- Any word in query matched. (OR)
This is what I have so far:
{
"query": {
"bool": {
"should": [
{
"multi_match": {
"query": "Debit card charges",
"fields": [
"title^4",
"description^3",
"keywords^3",
"procedurenumber^4"
],
"type": "most_fields",
"operator": "or",
"minimum_should_match": 1,
"tie_breaker": 0,
"analyzer": "standard",
"boost": 1,
"fuzziness": "AUTO",
"fuzzy_transpositions": true,
"auto_generate_synonyms_phrase_query": true,
"zero_terms_query": "none"
}
},
{
"match_phrase": {
"title": "Debit card charges"
}
}