diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-04-11 18:31:54 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-04-11 18:31:54 -0700 |
commit | 715b2e5b32a4603e1eb580133b9ae1a5837760fc (patch) | |
tree | a3b8331367d1ebe54dd48799ad1e77e73a22d58e | |
parent | f665ccc28c89db94508a410cde61c4321eb75f46 (diff) |
adding push support to search, only first matched result
-rw-r--r-- | system/api/search.go | 5 |
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]) |