Skip to content

Commit cdd1fbf

Browse files
veatchJason Veatch
authored andcommitted
Scripted updates are disabled by default in ES v5
1 parent 9ac70f3 commit cdd1fbf

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

example/load.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def load_repo(client, path=None, index='git'):
159159
{'_type': 'repos', '_id': 'elasticsearch', '_source': {
160160
'owner': {'name': 'Shay Bannon', 'email': 'kimchy@gmail.com'},
161161
'created_at': datetime(2010, 2, 8, 15, 22, 27),
162-
'tags': ['search', 'distributed', 'lucene'],
162+
'tags': ['search', 'distributed', 'lucene', 'java'],
163163
'description': 'You know, for search.'}
164164
},
165165

@@ -191,19 +191,6 @@ def load_repo(client, path=None, index='git'):
191191
es_repo = es.get(index='git', doc_type='repos', id='elasticsearch')
192192
print('%s: %s' % (es_repo['_id'], es_repo['_source']['description']))
193193

194-
# update - add java to es tags
195-
es.update(
196-
index='git',
197-
doc_type='repos',
198-
id='elasticsearch',
199-
body={
200-
"script" : "ctx._source.tags += tag",
201-
"params" : {
202-
"tag" : "java"
203-
}
204-
}
205-
)
206-
207194
# refresh to make the documents available for search
208195
es.indices.refresh(index='git')
209196

0 commit comments

Comments
 (0)