I get a parse error when trying to index a JSON file. I am running this from the Python API for ES and, as I step deep into the code, it appears to be based on the format that Tika generates. I have a very simple TXT file (with a few sentences in it) which I ran through Tika converted to JSON. When I check at jsonlint it shows as valid JSON. After stepping into the code, it appears to be an issue with the fact that Tika uses square brackets at the beginning and end of the file rather than curly braces. So, it is valid JSON but chokes when I try to index in ES. I would attach the file but it is not an allowed file type.
Has anyone had this issue with Tika? It is such a ubiquitous tool that I find it odd that the file will not index easily. Is there another tool that I can use that will convert many file types (as many as Tika) that does work? Just so it is here, I am using sample code provided by Elastic PY here (endpoint URL omitted); error occurs at res.index:
es = Elasticsearch('https://[omitted].com:30737')
res = requests.get('https:/[omitted]com:30737')
print(res.content)
f = open("content.txt.json", "r")
content = json.load(f)
f.close()
res = es.index(index="json-test-index", doc_type='test', id=2, body=content)
print(res['created'])