FAQ Database Discussion Community


Getting Parse error for elasticsearch-py

python,elasticsearch,elastic,elasticsearch-py
I am trying to search my entire elasticsearch data for a certain word "tsbu" within a time range. When I try running this, I get a SearchParseException and Parse Failure. es = Elasticsearch() doc = { "query": { "match" : { "message" : "tsbu" } }, "range" : { "@timestamp"...

How to update a document using elasticsearch-py?

python,elasticsearch,elasticsearch-py
Does anyone have an example for how to use update? It's documented here, but the documentation is unclear and doesn't included a working example. I've tried the following: coll = Elasticsearch() coll.update(index='stories-test',doc_type='news',id=hit.meta.id, body={"stanford": 1, "parsed_sents": parsed }) and I get elasticsearch.exceptions.RequestError: TransportError(400, u'ActionRequestValidationException[Validation Failed: 1: script or doc is missing;]')...