From 3ed1df2e5369740dd75386e41ad6a65f3d79fda7 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 10 Dec 2025 21:06:53 -0500 Subject: [PATCH] refac: search notes db query --- backend/open_webui/models/notes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/models/notes.py b/backend/open_webui/models/notes.py index 2ca932ff7f..cfeddf4a8c 100644 --- a/backend/open_webui/models/notes.py +++ b/backend/open_webui/models/notes.py @@ -255,7 +255,9 @@ class NoteTable: query = query.filter( or_( Note.title.ilike(f"%{query_key}%"), - Note.data["content"]["md"].ilike(f"%{query_key}%"), + cast(Note.data["content"]["md"], Text).ilike( + f"%{query_key}%" + ), ) )