Permalink
Browse files

Delete type "doc" if no type specified

  • Loading branch information...
1 parent 3c2b0c1 commit eeaa5748c2c3af4313652562810123b29ddb8ed8 @gsf gsf committed Mar 28, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/elasticsearch.js
View
@@ -43,7 +43,7 @@ ElasticSearch.prototype.add = function(opts, doc, cb) {
}
var def = {
method: ((opts.id)?'PUT':'POST'),
- path: '/' + this.index + '/' + (opts.type || 'doc') + '/' + (opts.id || '') + ((opts.refresh)?'?refresh=true':'')
+ path: '/' + this.index + '/' + (opts.type || 'doc') + '/' + (opts.id || '') + (opts.refresh?'?refresh=true':'')
};
utils.request(utils.mapConfig(def, utils.default_config, opts), doc, cb);
@@ -56,7 +56,7 @@ ElasticSearch.prototype.delete = function(opts, cb) {
}
var def = {
method: 'DELETE',
- path: '/' + this.index + '/' + ((opts.type)?(''+opts.type+((opts.id)?'/'+opts.id:'')):'') + ((opts.refresh)?'?refresh=true':'')
+ path: '/' + this.index + '/' + (opts.type || 'doc') + (opts.id?'/'+opts.id:'') + (opts.refresh?'?refresh=true':'')
};
utils.request(utils.mapConfig(def, utils.default_config, opts), undefined, cb);

0 comments on commit eeaa574

Please sign in to comment.