Multiple matches


#1

I can't find docs where I can specify multiple matches...theres 2 fields I want to match...transactiontype and fullAddress. transactionType is an exact match and fullAddress could have the postcode anywhere in the address

{
"from": 0,
"size": 10,
"match": {
"transactionType": "LEASE"
},
"match_phrase_prefix": {
"fullAddress": "BS22"
},
"sort": [{
"transactionDate": {
"order": "desc"
}
}]
}

The matches work seperately but not together...I know there are plenty of matches but it comes up as an error


(Christoph) #2

Hi,

try combining the two match queries as two clauses inside a Bool Query. It looks like you don't need scoring, so putting them inside the "filter" should work.


(system) #3