jjlj
This commit is contained in:
23
test_search.py
Normal file
23
test_search.py
Normal 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')}")
|
||||
|
||||
Reference in New Issue
Block a user