I'm using msearch to query ES. following is my query:-
[{
'index': u 'INDEX',
'type': u 'TYPE'
}, {
'query': {
'term': {
'FIELD1': u 'ID'
}
},
'from': 0,
'size': 1
}, {
'index': u 'INDEX',
'type': u 'TYPE'
}, {
'query': {
'function_score': {
'filter': {
'term': {
'source': u 'SOURCE'
}
},
'query': {
'dis_max': {
'tie_breaker': 0,
'queries': [{
'match': {
u 'FIELD2.shingle': {
'cutoff_frequency': 0,
'query': u 'QUERY',
'boost': 1,
'analyzer': 'shingle_analyzer',
'fuzziness': 1
}
}
}]
}
}
}
},
'min_score': 2,
'from': 0,
'size': 5 L
}]
ES_CLIENT.msearch(body=query)
Now it happens sometime, that there's an intersection between 1st and 2nd query results, which leads to duplicate results. How can I get unique results while using msearch in ES or do I've to handle it at application level?
boolwith twoshouldstatements?msearch. I cannot add both the queries into one using should and boo . I just add all the queries in one set.msearchjust runs the searches and returns the results for each. This is why I was asking aboutbool.msearch? Why did you choosemsearchand then wanting unique results?