diff --git a/src/auth.js b/src/auth.js
index 86af03e6d1718f0fa2ad329b8d9b13ebabc7b28e..2a263636c8e9cce24ecf132616ba9bd211848409 100644
--- a/src/auth.js
+++ b/src/auth.js
@@ -125,7 +125,7 @@ export class ResourceHandler {
 
     const fullQuery = {};
 
-    if ('search' in query && query.search && query.search.length > 0) {
+    if ('search' in query && query.search && query.search.length > 0 && this.searchKeys) {
       // translate search into where, we just look if any field contains search
       // The search-string may match any of the keys in the object specified in the
       // constructor