aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.py5
1 files changed, 5 insertions, 0 deletions
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",