Another example query, this time with an actual query

This commit is contained in:
Honza Král
2013-12-09 17:48:54 +01:00
parent 3e262779bb
commit 99eb8936a3
+21
View File
@@ -37,6 +37,27 @@ es = Elasticsearch()
print('Empty search:')
print_hits(es.search(index='git'))
print('Find commits that says "fix" without touching tests:')
result = es.search(
index='git',
doc_type='commits',
body={
'query': {
'filtered': {
'query': {
'match': {'description': 'fix'}
},
'filter': {
'not': {
'term': {'files': 'test_elasticsearch'}
}
}
}
}
}
)
print_hits(result)
print('Last 8 Commits for elasticsearch-py:')
result = es.search(
index='git',