Skip to content

Commit c9308a7

Browse files
committed
fix issue #264
1 parent 811b7e1 commit c9308a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/document.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ Document.prototype.search = function(query, limit, options, _resolve){
484484
if(!limit && is_object(query)){
485485

486486
options = /** @type {Object} */ (query);
487-
query = options["query"];
487+
query = "";
488488
}
489489
else if(is_object(limit)){
490490

@@ -506,12 +506,13 @@ Document.prototype.search = function(query, limit, options, _resolve){
506506
}
507507
else{
508508

509+
query = options["query"] || query;
509510
pluck = options["pluck"];
510511
field = pluck || options["index"] || options["field"] /*|| (is_string(options) && [options])*/;
511512
tag = SUPPORT_TAGS && options["tag"];
512513
enrich = SUPPORT_STORE && this.store && options["enrich"];
513514
bool = options["bool"] === "and";
514-
limit = options["limit"] || 100;
515+
limit = options["limit"] || limit || 100;
515516
offset = options["offset"] || 0;
516517

517518
if(tag){

0 commit comments

Comments
 (0)