summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-04-11 18:31:54 -0700
committerSteve Manuel <nilslice@gmail.com>2017-04-11 18:31:54 -0700
commit715b2e5b32a4603e1eb580133b9ae1a5837760fc (patch)
treea3b8331367d1ebe54dd48799ad1e77e73a22d58e
parentf665ccc28c89db94508a410cde61c4321eb75f46 (diff)
adding push support to search, only first matched result
-rw-r--r--system/api/search.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/system/api/search.go b/system/api/search.go
index 25a1bae..c743d9f 100644
--- a/system/api/search.go
+++ b/system/api/search.go
@@ -61,6 +61,11 @@ func searchContentHandler(res http.ResponseWriter, req *http.Request) {
return
}
+ // if we have matches, push the first as its matched by relevance
+ if len(bb) > 0 {
+ push(res, req, it, bb[0])
+ }
+
var result = []json.RawMessage{}
for i := range bb {
result = append(result, bb[i])