summaryrefslogtreecommitdiff
path: root/bucky/search/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'bucky/search/search.js')
-rw-r--r--bucky/search/search.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/bucky/search/search.js b/bucky/search/search.js
index a28d49c..4818ef9 100644
--- a/bucky/search/search.js
+++ b/bucky/search/search.js
@@ -1,5 +1,5 @@
var db = require('../db')
-var bdb = require('./bdb')
+var bdb = require('./bdb')('search')
var STOPWORDS = require('./stopwords')
var wordRegexp = new RegExp("(\W+)");
@@ -28,7 +28,7 @@ function find_term(term) {
strength: parseInt(partz[3]) || 1,
}
})
- console.log(matches)
+ // console.log(matches)
return matches
}
@@ -69,7 +69,7 @@ function search (query, start, limit) {
if (i < start) return false
if (to_display-- === 0) return true
results.push(match)
- console.log(match)
+ // console.log(match)
thread_ids.push(match.thread)
if (match.comment) comment_ids.push(match.comment)
if (match.file) file_ids.push(match.file)
@@ -77,16 +77,18 @@ function search (query, start, limit) {
})
return {
- query: query,
- start: start,
- next: start + limit,
- limit: limit,
- total: total,
+ meta: {
+ query: query,
+ terms: terms,
+ start: start,
+ next: start + limit,
+ limit: limit,
+ total: total,
+ },
results: results,
thread_ids: thread_ids,
comment_ids: comment_ids,
file_ids: file_ids,
- terms: terms,
};
}