user2319726
user2319726

Reputation: 143

Watson discovery results in pdf form in chatbot

I have connected my own conversation and discovery services using nodejs code and when i call discovery service from chatbot its responding back with the query results(where the result is of full pdf page details), below is the code which i have used to get the results but i want to know how to get the pdf short description and link and when we click it should open the pdf in different window.

Same like below link,https://assistant-with-discovery.ng.bluemix.net/

Please let me know how to get the results like above format. I have tried with below code and want to customize the discovery results with the pdf link. https://github.com/sayurimizuguchi/conversation-with-discovery/blob/master/app.js

Upvotes: 0

Views: 252

Answers (1)

Anton Prevosti
Anton Prevosti

Reputation: 92

The Watson Discovery service does not save the PDF document in its original format, so you need to save it somewhere yourself. Then, when you ingest your PDF to Discovery, you could pass in a custom metadata field, e.g. {"pdf_location": "http://myServer/pdfs/myPdf.pdf"} (see how to do it with the Java SDK here).

After ingesting your PDF, you will now be able to get the original PDF when you query Discovery by following the URL in the saved custom field.

Upvotes: 1

Related Questions