Search code examples
ibm-cloudibm-watsonwatson-discovery

Watson discovery highlight


I am Taka.

I tried to get the highlighted results on Watson Discovery in Node.red.
It doesn't work.
Could you tell me if we can get the highlighted results in Node.red
and how to do it if we can?

Here is that I tried. I created a function node in Node.red to pass query
from Discovery query builder to Discovery node as follows.

msg.discoveryparams = {};  
msg.discoveryparams.environment_id = 'xxxxxxxxxxxxx';  
msg.discoveryparams.collection_id = 'xxxxxxxxxxxxxxxx';  
msg.discoveryparams.nlp_query = true;  
msg.discoveryparams.query = msg.payload;<--query from query builder  
msg.discoveryparams.query_options = {highlight:true};  <-- add to get highlighted
return msg;  

Thanks.


Solution

  • query_options has not been implemented in the Node-RED node for Discovery. If you would like it to be be implemented them please raise an issue against the github repo - https://github.com/watson-developer-cloud/node-red-node-watson