I'm trying to get the ID-s of all documents uploaded to IBM Watson Discovery API
It's not obvious from the documentation, but I guess it must be possible?
The structure is:
+--------------------------------------------------+
| Environment |
| |
| +--------------------------------+ |
| | Collection | |
| | | |
| | +--------------+ | |
| | | Document | | |
| | | | | |
| | +--------------+ | |
| | | |
| +--------------------------------+ |
| |
+--------------------------------------------------+
How can I get a list of all documents in a collection?
.
I have tried:
Collections -> List collection fields
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/fields?version=2019-04-30"
Queries -> Query a collection (GET)
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/query?version=2019-04-30"
Environments -> Get environment info
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}?version=2019-04-30"
Training data -> List training data
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data?version=2019-04-30"
None of these give the list of documents.
.
UPDATE:
Thanks to @Catbelly's answer, the correct way to get a list of documents is:
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/query?version=2019-04-30&return=id
The Query endpoint is the only way to do this - if you set the return
value equal to id
you will only get ids back. (I am a IBM Watson employee)