diff --git a/entrypoint.go b/entrypoint.go index a4de72d..2737b40 100644 --- a/entrypoint.go +++ b/entrypoint.go @@ -289,14 +289,14 @@ func NewRequest(collection LibDataEnum, peerID string, groups []string, caller * * @param c ...*tools.HTTPCaller * @return data LibDataShallow */ -func (r *Request) Search(filters *dbs.Filters, word string, collection LibDataEnum) (data LibDataShallow) { +func (r *Request) Search(filters *dbs.Filters, word string) (data LibDataShallow) { defer func() { // recover the panic if r := recover(); r != nil { tools.UncatchedError = append(tools.UncatchedError, errors.New("Panic recovered in Search : "+fmt.Sprintf("%v", r))) data = LibDataShallow{Data: nil, Code: 500, Err: "Panic recovered in LoadAll : " + fmt.Sprintf("%v", r) + " - " + string(debug.Stack())} } }() - d, code, err := models.Model(collection.EnumIndex()).GetAccessor(r.peerID, r.groups, r.caller).Search(filters, word) + d, code, err := models.Model(r.collection.EnumIndex()).GetAccessor(r.peerID, r.groups, r.caller).Search(filters, word) if err != nil { data = LibDataShallow{Data: d, Code: code, Err: err.Error()} return