I am using the elasticsearch-dsl package in Python for my project. I have a very simple search query as can be seen below:
s = Search(using=connections.get_connection(), index= 'registry', doc_type=['storage_doc']).params(request_timeout=60)
s.filter("match", postcode="SW1").query("match", forename="Brendan")
response = s.execute(ignore_cache=True)
print(response.success())
print(response.took)
print(response.to_dict())
print('Total %d hits found.' % response.hits.total)
which works fine if I execute it in debug mode but when I run the code from the console I always get 0 hits. I have no idea why this is happening and I have spent already half a day trying to find a solution. Any ideas?