diff --git a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
--- a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
+++ b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
@@ -176,6 +176,11 @@
       std::string original_message_id,
       std::string message_id,
       std::string processed_content) const = 0;
+  virtual std::vector<MessageEntity> searchMessages(
+      std::string query,
+      std::string threadID,
+      std::optional<std::string> timestampCursor,
+      std::optional<std::string> messageIDCursor) const = 0;
 
 #ifdef EMSCRIPTEN
   virtual std::vector<WebThread> getAllThreadsWeb() const = 0;
@@ -185,6 +190,11 @@
   virtual NullableString getOlmPersistAccountDataWeb(int accountID) const = 0;
   virtual std::vector<MessageWithMedias>
   getRelatedMessagesWeb(const std::string &messageID) const = 0;
+  virtual std::vector<MessageWithMedias> searchMessagesWeb(
+      std::string query,
+      std::string threadID,
+      std::optional<std::string> timestampCursor,
+      std::optional<std::string> messageIDCursor) const = 0;
 #else
   virtual void createMainCompaction(std::string backupID) const = 0;
   virtual void captureBackupLogs() const = 0;
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
@@ -189,6 +189,11 @@
       std::string original_message_id,
       std::string message_id,
       std::string processed_content) const override;
+  std::vector<MessageEntity> searchMessages(
+      std::string query,
+      std::string threadID,
+      std::optional<std::string> timestampCursor,
+      std::optional<std::string> messageIDCursor) const override;
 
 #ifdef EMSCRIPTEN
   std::vector<WebThread> getAllThreadsWeb() const override;
@@ -198,6 +203,11 @@
   NullableString getOlmPersistAccountDataWeb(int accountID) const override;
   std::vector<MessageWithMedias>
   getRelatedMessagesWeb(const std::string &messageID) const override;
+  std::vector<MessageWithMedias> searchMessagesWeb(
+      std::string query,
+      std::string threadID,
+      std::optional<std::string> timestampCursor,
+      std::optional<std::string> messageIDCursor) const override;
 #else
   static void clearSensitiveData();
   static void initialize(std::string &databasePath);
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -2551,6 +2551,15 @@
   return this->processMessagesResults(preparedSQL);
 }
 
+std::vector<MessageEntity> SQLiteQueryExecutor::searchMessages(
+    std::string query,
+    std::string threadID,
+    std::optional<std::string> timestampCursor,
+    std::optional<std::string> messageIDCursor) const {
+
+  return std::vector<MessageEntity>{};
+}
+
 #ifdef EMSCRIPTEN
 std::vector<WebThread> SQLiteQueryExecutor::getAllThreadsWeb() const {
   auto threads = this->getAllThreads();
@@ -2604,6 +2613,23 @@
 
   return relatedMessagesWithMedias;
 }
+
+std::vector<MessageWithMedias> SQLiteQueryExecutor::searchMessagesWeb(
+    std::string query,
+    std::string threadID,
+    std::optional<std::string> timestampCursor,
+    std::optional<std::string> messageIDCursor) const {
+  auto allMessages =
+      this->searchMessages(query, threadID, timestampCursor, messageIDCursor);
+
+  std::vector<MessageWithMedias> allMessagesWithMedias;
+  for (auto &messageWithMedia : allMessages) {
+    allMessagesWithMedias.push_back(
+        {std::move(messageWithMedia.first), messageWithMedia.second});
+  }
+
+  return allMessagesWithMedias;
+}
 #else
 void SQLiteQueryExecutor::clearSensitiveData() {
   SQLiteQueryExecutor::closeConnection();
diff --git a/web/shared-worker/_generated/comm_query_executor.wasm b/web/shared-worker/_generated/comm_query_executor.wasm
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

literal 0
Hc$@<O00001