diff --git a/lib/xapor/model_integration.rb b/lib/xapor/model_integration.rb
index <HASH>..<HASH> 100644
--- a/lib/xapor/model_integration.rb
+++ b/lib/xapor/model_integration.rb
@@ -16,7 +16,7 @@ module Xapor::XapianFuIntegration
         include XapianFu
 
         def search(query)
-          @db.search(query)
+          xapor_db.search(query)
         end
 
         def xapor_config
Was using class var during search, before it had been initialised