Right now I'm just passing in the dict representing the JSON DSL:
s = s.query({
'nested': {
'path': 'activity_tags',
'query': {
'terms': {
'activity_tags.id': data['activity_tags[]']
}
}
}
})
But is there a way to rephrase this using the Python DSL directly?
s = s.filter('nested', path='activity_tags', ... ?)
from elasticsearch_dsl import Q
s = s.query("nested", path="activity_tags", query=Q("terms", activity_tags__id=data['activity_tags[]']))
Should do the trick
Sweet, thanks again! :+1:
Most helpful comment
Should do the trick