diff options
author | Anthony Wang | 2024-07-27 16:12:32 +0000 |
---|---|---|
committer | Anthony Wang | 2024-07-27 16:12:32 +0000 |
commit | cd5f01368954d1e1295f9b4f477d9d586e6903b0 (patch) | |
tree | 7beab8bf6f5ece97e2b38bf03e0c742c7299f1b7 | |
parent | db8abe2af3f827b5f78fd1f674d334385b15e3e3 (diff) |
Print out search queries, skip hidden files
-rw-r--r-- | server.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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", |