[英]Watson Discovery Service - Query Data collection Node.js - passage missing
我對Watson Discovery Service的響應進行查詢,我想在響應中包含這些段落(默認情況下,不包含這些段落,使用passions = true應該包含它。但是我不明白。
var queryString = {'natural_language_query':searchString};
insert(cloudantDb,"9", "Call freie Textsuche ", queryString, "-", params);
return new Promise ((resolve, reject) => {
discovery.query({
environment_id: 'my env id',
collection_id: 'my coll id',
query: queryString,
passages: true,
count: 3
}
有人可以幫忙嗎?
在這種情況下,您需要在queryoptions參數中設置段落,就像該API參考用於測試一樣。
var queryOptions = {'natural_language_query':searchString, 'passages': true};
嘗試使用此參數查看cURL示例:
curl -u "{username}":"{password}" "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/collections/{collection_id}/query?version=2017-06-25&natural_language_query='collie'&passages=true"
注意:僅私有集合支持passions參數。 Watson Discovery News集合不支持此功能。 您不能在相同的查詢選項中使用natural_language_query
和query
參數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.