This code works correctly and gives me objectAPIresponse.
But making small change to the code as such:
client.get(index="abc-*",id = '--index001')
gives me an error:
AuthorizationException: AuthorizationException(403, 'security_exception', 'action [indices:data/read/get] is unauthorized for API key id [<id>] of user [<user>], this action is granted by the index privileges [read,all]')
I face same issue when using client.exists(index,id)
I need to assume that I don't know the full index name and need to know if index "abc-*" does exists in deployment. Even somehow if we can ignore the id and just know if the index is existing, that would be helpful.
I am running the code through VScode but same can be run on Jupyter notebook.
The authentication works correctly for me. I was able to even get correct search result when I do not use wildcard '*' character.
But I was facing issue when I used wildcard in index name.
Anyways, The problem is solved for me using:
client.search(index = index,body = query)
I can use wildcard character in index name and query multiple index at once.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.