Closed ayushidalmia closed 8 years ago
The cluster your account is under could be under the load, so the index is not available on the other nodes yet, does the problem persist if you try again?
Yes. It does.
Can you review the method in which I am querying the index?
I would recommend using the get_search_result
It still throws the same error. I did the following:
#query search index
resp = my_database.get_search_result("ddoc", "freesearch",
query='*:*',
include_docs=True)
for row in resp['rows']:
print row
And get this error:
Traceback (most recent call last):
File "search.py", line 55, in <module>
include_docs=True)
File "/Library/Python/2.7/site-packages/cloudant/database.py", line 1355, in get_search_result
resp.raise_for_status()
File "/Library/Python/2.7/site-packages/requests/models.py", line 862, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Object Not Found not_found missing for url: https://3f4e3c29-dc84-48ba-833f-4fe71ed45ada-bluemix:87bf0c3b2df8edaad3ba29da3451aa5d4230bbda70cccca89447a570c50ef3cc@3f4e3c29-dc84-48ba-833f-4fe71ed45ada-bluemix.cloudant.com/abof/_design/ddoc/_search/freesearch
Can you review if the index is created?
Are you sure you are searching with the correct design document name?
In the earlier snippet you created a design document with the name DDOC/_view/INDEX
:
ddoc = DesignDocument(my_database,"_design/DDOC/_view/INDEX")
but you are trying to search using the design document with the name ddoc
which if it doesn't exist would explain the 404
.
Thanks. It worked.
Great, glad to hear its working for you.
I am doing the following:
However, it gives the following error:
I am using Python 2.7 and cloudant 2.1.0 Also, what will be a good help place for python cloudant?