Updated example queries for ES v5
This commit is contained in:
committed by
Jason Veatch
parent
cdd1fbf6a0
commit
3401b21f1c
+11
-21
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user