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',
|
doc_type='commits',
|
||||||
body={
|
body={
|
||||||
'query': {
|
'query': {
|
||||||
'filtered': {
|
'bool': {
|
||||||
'query': {
|
'must': {
|
||||||
'match': {'description': 'fix'}
|
'match': {'description': 'fix'}
|
||||||
},
|
},
|
||||||
'filter': {
|
'must_not': {
|
||||||
'not': {
|
'term': {'files': 'test_elasticsearch'}
|
||||||
'term': {'files': 'test_elasticsearch'}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,8 +60,8 @@ result = es.search(
|
|||||||
doc_type='commits',
|
doc_type='commits',
|
||||||
body={
|
body={
|
||||||
'query': {
|
'query': {
|
||||||
'filtered': {
|
'bool': {
|
||||||
'filter': {
|
'must': {
|
||||||
'term': {
|
'term': {
|
||||||
# parent ref is stored as type#id
|
# parent ref is stored as type#id
|
||||||
'_parent': 'repos#elasticsearch-py'
|
'_parent': 'repos#elasticsearch-py'
|
||||||
@@ -86,19 +84,11 @@ result = es.search(
|
|||||||
body={
|
body={
|
||||||
'size': 0,
|
'size': 0,
|
||||||
'query': {
|
'query': {
|
||||||
'filtered': {
|
'has_parent': {
|
||||||
'filter': {
|
'parent_type': 'repos',
|
||||||
'has_parent': {
|
'query': {
|
||||||
'type': 'repos',
|
'term': {
|
||||||
'query': {
|
'tags': 'python'
|
||||||
'filtered': {
|
|
||||||
'filter': {
|
|
||||||
'term': {
|
|
||||||
'tags': 'python'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user