Skip to content

Commit

Permalink
Merge pull request #8 from nverwer/master
Browse files Browse the repository at this point in the history
Added more-like-this query.
  • Loading branch information
mikepb committed Oct 19, 2013
2 parents ffcaa86 + 1295159 commit 637e67b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion sage.js
Expand Up @@ -903,6 +903,7 @@ Apache License
/**
* Update document.
*
* @param {String} id document ID
* @param {String} doc
* @param {Object} [query]
* @param {Object} [headers]
Expand All @@ -911,9 +912,22 @@ Apache License
*/

up: function(id, doc /* [query], [headers], [callback] */) {
// prevent acidentally creating index
// prevent accidentally creating index
if (!this.name || !id) throw new Error('missing type or id');
return this._(arguments, 2)('POST', id + '/_update', { b: doc });
},

/**
* More-like-this query.
*
* @param {String} id document ID
* @param {Object} [query]
* @param {Object} [headers]
* @param {Object} [callback]
* @return this
*/
mlt : function(id /*, [query], [headers], [callback] */) {
return this._(arguments, 1)('GET', id + '/_mlt');
}

};
Expand Down

0 comments on commit 637e67b

Please sign in to comment.