aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/app.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/app.js b/lib/app.js
index ca9b6b2..b63a13e 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -123,9 +123,11 @@ App.prototype.unboxMsg = function (msg, cb) {
}
App.prototype.search = function (opts) {
- var search = this.sbot.fulltext && this.sbot.fulltext.search
- if (!search) return pull.error(new Error('Missing fulltext search plugin'))
- return search(opts)
+ var fsearch = this.sbot.fulltext && this.sbot.fulltext.search
+ if (fsearch) return fsearch(opts)
+ var search = this.sbot.search && this.sbot.search.query
+ if (search) return search({query: opts})
+ return pull.error(new Error('Search needs ssb-fulltext or ssb-search plugin'))
}
App.prototype.advancedSearch = function (opts) {