Scripted updates are disabled by default in ES v5

This commit is contained in:
Jason Veatch
2016-12-01 13:45:21 -05:00
committed by Jason Veatch
parent 9ac70f3dcb
commit cdd1fbf6a0
+1 -14
View File
@@ -159,7 +159,7 @@ REPO_ACTIONS = [
{'_type': 'repos', '_id': 'elasticsearch', '_source': {
'owner': {'name': 'Shay Bannon', 'email': '[email protected]'},
'created_at': datetime(2010, 2, 8, 15, 22, 27),
'tags': ['search', 'distributed', 'lucene'],
'tags': ['search', 'distributed', 'lucene', 'java'],
'description': 'You know, for search.'}
},
@@ -191,19 +191,6 @@ if __name__ == '__main__':
es_repo = es.get(index='git', doc_type='repos', id='elasticsearch')
print('%s: %s' % (es_repo['_id'], es_repo['_source']['description']))
# update - add java to es tags
es.update(
index='git',
doc_type='repos',
id='elasticsearch',
body={
"script" : "ctx._source.tags += tag",
"params" : {
"tag" : "java"
}
}
)
# refresh to make the documents available for search
es.indices.refresh(index='git')