Below code creates traceback that follows. I am trying to get json file into and out of ES and have checked documentation but cannot seem to resolve. Appreciate any help!
Code:
d = {}
def text_to_json(data):
for k,v in data.items():
with open(v, 'r') as r:
cont = r.read().strip()
d[k] = cont
a = json.dumps(d)
return a
engine_and_file = {
'Google': './page_content_first.txt/part-00000',
}
a = (text_to_json(engine_and_file))
es.index('webpage-import', 'html', a)
es.get('webpage-import', 'html', id=1)
Traceback (most recent call last):
File "/home/ubuntu/Python_Projects/Spark/spark-1.5.1-bin-hadoop2.6/./Spark_FileImport_Test.py", line 60, in
es.get('webpage-import', 'html', id=1)
File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/utils.py", line 69, in _wrapped
return func(*args, params=params, **kwargs)
TypeError: get() got multiple values for keyword argument 'id'