diff options
author | Tornike Razmadze <torniker@gmail.com> | 2018-03-01 22:01:59 +0400 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2018-03-05 22:24:53 -0700 |
commit | 4ce9a46dccafabe120aa5f798aeab38e1fee9f63 (patch) | |
tree | cb50c6625deb840cbcc34ed229f5f6bfaeb1c898 /system/search/search.go | |
parent | c2d1bb070fdaf30c54f7c0d339e24929e7e1072f (diff) |
added count and offset to search api (#232)
Diffstat (limited to 'system/search/search.go')
-rw-r--r-- | system/search/search.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/search/search.go b/system/search/search.go index 0b058bf..8cd0fe6 100644 --- a/system/search/search.go +++ b/system/search/search.go @@ -142,14 +142,14 @@ func DeleteIndex(id string) error { // TypeQuery conducts a search and returns a set of Ponzu "targets", Type:ID pairs, // and an error. If there is no search index for the typeName (Type) provided, // db.ErrNoIndex will be returned as the error -func TypeQuery(typeName, query string) ([]string, error) { +func TypeQuery(typeName, query string, count, offset int) ([]string, error) { idx, ok := Search[typeName] if !ok { return nil, ErrNoIndex } q := bleve.NewQueryStringQuery(query) - req := bleve.NewSearchRequest(q) + req := bleve.NewSearchRequestOptions(q, count, offset, false) res, err := idx.Search(req) if err != nil { return nil, err |