Using ES 5.2.0.
When I do:
{'query': {'bool': {'filter': {'bool': {'should': [{'bool': {'filter': {'bool': {'should': [{'term': {'title_raw': {'value': 'stylebubble', '_name': 'stylebubble'}}}], 'must': ({'type': {'value': 'editorial_source'}},)}}}}]}}}}}
I get the right return with matched-queries:
{u'hits': {u'hits': [{u'_score': 0.0, u'_type': u'editorial_source', u'_id': u'3a34655e-84d4-11e6-a5d1-3b1a0960c5bb', u'matched_queries': [u'stylebubble'], u'_index': u'triangulr'}], u'total': 1, u'max_score': 0.0}, u'_shards': {u'successful': 1, u'failed': 0, u'total': 1}, u'took': 11, u'timed_out': False}
But if I do multiple matched-queries ( i'm searching for 5 different types), the first one no longer works (but all the other work, while I'm pasting only 2 here):
{'query': {'bool': {'filter': {'bool': {'should': [{'bool': {'filter': {'bool': {'should': [{'term': {'title_raw': {'value': 'stylebubble', '_name': 'stylebubble'}}}], 'must': ({'type': {'value': 'editorial_source'}},)}}}}, {'bool': {'filter': {'bool': {'should': [{'term': {'name_raw': {'value': 'stylebubble', '_name': 'stylebubble'}}}, {'term': {'slug': {'value': 'stylebubble', '_name': 'stylebubble'}}}, {'term': {'aliases': {'value': 'stylebubble', '_name': 'stylebubble'}}}], 'must': ({'type': {'value': 'brand'}}, {'range': {'visible_product_count': {'gte': 5}}})}}}}]}}}}}
Response:
u'hits': {u'hits': [{u'_score': 0.0, u'_type': u'editorial_source', u'_id': u'3a34655e-84d4-11e6-a5d1-3b1a0960c5bb', u'_index': u'triangulr'}], u'total': 1, u'max_score': 0.0}, u'_shards': {u'successful': 1, u'failed': 0, u'total': 1}, u'took': 6, u'timed_out': False}
What am I doing wrong or is it just a bug ?