Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from elasticsearch import Elasticsearch
- es = Elasticsearch("localhost:9200")
- es.update(index='test',doc_type='test1',id='1',body={'doc' {'username':'Tom'},'doc_as_upsert':True})
- POST /website/pageviews/1/_update
- {
- "script" : "ctx._source.views+=1",
- "upsert": {
- "views": 1
- }
- }
- from elasticsearch import Elasticsearch
- es = Elasticsearch()
- es.update(
- index="test",
- doc_type="test1",
- id="1",
- body={"script": "ctx._source.tags+=new_tag",
- "params": {
- "new_tag" : "search"
- }
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement