From 469dce00458887f8720af60d66068562d2b473bb Mon Sep 17 00:00:00 2001 From: yichuan-w Date: Wed, 12 Nov 2025 08:46:05 +0000 Subject: [PATCH] add test --- issue_159.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/issue_159.py b/issue_159.py index f3d2bf2..61dc1d7 100644 --- a/issue_159.py +++ b/issue_159.py @@ -39,8 +39,9 @@ def test_search_performance(): print("Testing LEANN Search Performance (Issue #159)") print("=" * 80) - # Check if index exists - if Path(INDEX_PATH).exists(): + # Check if index exists - skip build if it does + index_path = Path(INDEX_PATH) + if True: print(f"\n✓ Index already exists at {INDEX_PATH}") print(" Skipping build phase. Delete the index to rebuild.") else: @@ -77,6 +78,15 @@ def test_search_performance(): test_query = "LEANN向量数据库存储优化" + # Test with default complexity (64) + print(f"\n Test 1: Default complexity (64) `1 ") + print(f" Query: '{test_query}'") + start_time = time.time() + results = searcher.search(test_query, top_k=10, complexity=64, beam_width=BEAM_WIDTH) + search_time = time.time() - start_time + print(f" ✓ Search completed in {search_time:.2f} seconds") + print(f" Results: {len(results)} items") + # Test with default complexity (64) print(f"\n Test 1: Default complexity (64)") print(f" Query: '{test_query}'")