Skip to content

Instantly share code, notes, and snippets.

@0xc0d
Created April 8, 2019 09:21
Show Gist options
  • Save 0xc0d/69572323884ec0b11261ec61e439c043 to your computer and use it in GitHub Desktop.
Save 0xc0d/69572323884ec0b11261ec61e439c043 to your computer and use it in GitHub Desktop.
implementation of Elasticsearch should query in Python 3
def should(sample, conditions, min_should):
return True if len([item for item in conditions if item in sample]) >= min_should else False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment