How to get document ids from collection in Watson Discovery

Is there any way to list metadata(like id, filename etc.) about documents which belong to certain collection of Watson Discovery? There are some API methods which need document id (like "delete document" for example), so obviously there should be a way to get this id. However I was not able to find how to do it (neither via UI nor via API).

asked Jul 11, 2017 at 11:46 524 3 3 silver badges 17 17 bronze badges

2 Answers 2

Ok, the answer was obvious - to query the collection via Discovery Query Language.

The query *.* will list all the documents in the collection.

answered Jul 11, 2017 at 11:57 524 3 3 silver badges 17 17 bronze badges

You can use the query language to retrieve information about documents in a collection. At the time of this posting, using the following query should return 10 documents with all available metadata (replacing the appropriate values in <> with your collection-specific details):

curl -u ":" "https://gateway.watsonplatform.net/discovery/api/v1/environments//collections//query?count=10&return=extracted_metadata&version=2017-01-01" 
answered Jul 11, 2017 at 16:13 Andrew Turgeon Andrew Turgeon 181 2 2 bronze badges

Related

Hot Network Questions

Subscribe to RSS

Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2024.9.4.14806