diff --git a/example/queries.py b/example/queries.py index 10ffcd67..d487fcb8 100644 --- a/example/queries.py +++ b/example/queries.py @@ -41,14 +41,12 @@ result = es.search( doc_type='commits', body={ 'query': { - 'filtered': { - 'query': { + 'bool': { + 'must': { 'match': {'description': 'fix'} }, - 'filter': { - 'not': { - 'term': {'files': 'test_elasticsearch'} - } + 'must_not': { + 'term': {'files': 'test_elasticsearch'} } } } @@ -62,8 +60,8 @@ result = es.search( doc_type='commits', body={ 'query': { - 'filtered': { - 'filter': { + 'bool': { + 'must': { 'term': { # parent ref is stored as type#id '_parent': 'repos#elasticsearch-py' @@ -86,19 +84,11 @@ result = es.search( body={ 'size': 0, 'query': { - 'filtered': { - 'filter': { - 'has_parent': { - 'type': 'repos', - 'query': { - 'filtered': { - 'filter': { - 'term': { - 'tags': 'python' - } - } - } - } + 'has_parent': { + 'parent_type': 'repos', + 'query': { + 'term': { + 'tags': 'python' } } }