From cd5f01368954d1e1295f9b4f477d9d586e6903b0 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sat, 27 Jul 2024 16:12:32 +0000 Subject: Print out search queries, skip hidden files --- server.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.py b/server.py index d993a30..ac8ea15 100644 --- a/server.py +++ b/server.py @@ -59,6 +59,10 @@ class EventHandler(FileSystemEventHandler): def index(path, parent): + if os.path.basename(path).startswith("."): + # Skip hidden files + return + print("Indexing", path, parent) s = os.stat(path) if os.path.isfile(path): @@ -133,6 +137,7 @@ def unindex(id): def search(text, limit): + print("Search", text, limit) emb = model.embed_text(text).cpu().numpy() res = cur.execute( "SELECT idx.path FROM emb LEFT JOIN idx ON emb.id = idx.id WHERE embedding MATCH ? AND k = ? ORDER BY distance", -- cgit v1.2.3-70-g09d2