Skip to content

Commit 12d9d36

Browse files
authored
Merge pull request watson-developer-cloud#501 from kx-applied-labs/master
add passage extraction parameters [semver minor]
2 parents e6cc3c8 + 1104b1f commit 12d9d36

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

discovery/v1.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,9 @@ DiscoveryV1.prototype.deleteDocument = function(params, callback) {
662662
* @param {String} [params.return] A comma separated list of the portion of the document hierarchy to return.
663663
* @param {String} [params.sort] A comma separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.
664664
* @param {Boolean} [params.passages=false] BETA - A boolean that specifies whether the service returns a set of the most relevant passages from the documents returned by a query. The passages parameter works only on private collections. It does not work in the Watson Discovery News collection.
665+
* @param {String} [params.passages.fields] A comma-separated list of fields in the index that passages will be drawn from. If this parameter not specified then all top level field are included.
666+
* @param {Number} [params.passages.count=10] The maximum number of passages to return. The search will return fewer if that is the total number found. The default is 10. The maximum is 100.
667+
* @param {Number} [params.passages.characters=400] The approximate number of characters that any one passage should have. The default is 400. The minimum is 50. The maximum is 2000.
665668
*/
666669
DiscoveryV1.prototype.query = function(params, callback) {
667670
params = params || {};
@@ -677,7 +680,21 @@ DiscoveryV1.prototype.query = function(params, callback) {
677680
method: 'GET',
678681
json: true,
679682
path: pick(params, ['environment_id', 'collection_id']),
680-
qs: pick(params, ['query', 'natural_language_query', 'filter', 'aggregation', 'count', 'offset', 'return', 'sort', 'passages', 'highlight'])
683+
qs: pick(params, [
684+
'query',
685+
'natural_language_query',
686+
'filter',
687+
'aggregation',
688+
'count',
689+
'offset',
690+
'return',
691+
'sort',
692+
'passages',
693+
'highlight',
694+
'passages.fields',
695+
'passages.count',
696+
'passages.characters'
697+
])
681698
},
682699
requiredParams: ['environment_id', 'collection_id'],
683700
defaultOptions: this._options

0 commit comments

Comments
 (0)