This commit is contained in:
nose
2025-11-27 10:59:01 -08:00
parent e9b505e609
commit 9eff65d1af
30 changed files with 2099 additions and 1095 deletions

23
test_search.py Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env python
import sys
sys.path.insert(0, '.')
from helper.file_storage import LocalStorageBackend
from config import get_local_storage_path
import json
config = json.load(open('config.json'))
# Get the location string properly
location = get_local_storage_path(config)
if isinstance(location, dict):
location = location.get('path') or str(location)
backend = LocalStorageBackend(config)
# Test searches
for query in ['sie*', 'sie', '*']:
print(f"\n=== Searching for: {query} ===")
results = backend.search(query, location=str(location), limit=5)
print(f"Found {len(results)} results")
for r in results:
print(f" - {r.get('title')} ({r.get('ext')}) @ {r.get('path')}")