Created
November 28, 2020 13:45
-
-
Save alexlarkou/2256b99e493e0be89ba00b4a3ce03c6d to your computer and use it in GitHub Desktop.
search example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from elasticsearch_dsl.search import Search | |
search = Search(using="default", index=index, doc_type=["doc"]) | |
# we only want warning log in this instance | |
search = search.filter('term', level='warning') | |
# we look for results whose text includes the query "invalid argument" | |
search = search.query("multi_match", query="invalid argument", fields=["response.message", "stacktrace"], type="most_prefix") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment