Skip to content

Commit

Permalink
Merge pull request #218 from watson-developer-cloud/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
germanattanasio committed Mar 3, 2016
2 parents 2f4eb32 + 8cdf250 commit c7a82ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/retrieve_and_rank_solr.v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var retrieve = watson.retrieve_and_rank({
var clusterId = 'INSERT YOUR CLUSTER ID HERE';
var collectionName = 'example_collection';
var configName = 'example_config';
var configZipPath = 'examples/resources/example_solr_config.zip';
var configZipPath = __dirname + '/resources/example_solr_config.zip';

var solrClient = retrieve.createSolrClient({
cluster_id: clusterId,
Expand Down
8 changes: 4 additions & 4 deletions services/retrieve_and_rank/v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,20 +304,20 @@ RetrieveAndRank.prototype.listConfigs = function(params, callback) {
RetrieveAndRank.prototype.uploadConfig = function(params, callback) {
params = params || {};

var configFile = params.config_zip_path;
if (!params.config_zip_path) {
callback(new Error('Missing required parameters: config_zip_path'));
return;
} else if (typeof(params.config_zip_path) === 'string') {
configFile = fs.createReadStream(params.config_zip_path);
} else if (!typeof(params.config_zip_path) === 'string') {
callback(new Error('Parameters config_zip_path is not a string'));
return;
}
var configFile = fs.readFileSync(params.config_zip_path);

var parameters = {
options: {
url: '/v1/solr_clusters/{cluster_id}/config/{config_name}',
method: 'POST',
path: params,
json: true,
body: configFile,
headers: {
'content-type': 'application/zip'
Expand Down

0 comments on commit c7a82ed

Please sign in to comment.