()
| 347 | |
| 348 | #[test] |
| 349 | fn multi_term_query() { |
| 350 | let (idx, _dir) = open_test_index(); |
| 351 | |
| 352 | idx.index_document("docs", "d1", &vec![(1, 0.5), (2, 0.3)]) |
| 353 | .unwrap(); |
| 354 | idx.index_document("docs", "d2", &vec![(1, 0.2), (2, 0.9)]) |
| 355 | .unwrap(); |
| 356 | |
| 357 | // Query both tokens: d2 should win (0.2*1.0 + 0.9*1.0 = 1.1 > 0.5 + 0.3 = 0.8). |
| 358 | let results = idx.search("docs", &vec![(1, 1.0), (2, 1.0)], 10).unwrap(); |
| 359 | assert_eq!(results[0].doc_id, "d2"); |
| 360 | } |
| 361 | |
| 362 | #[test] |
| 363 | fn collection_isolation() { |
nothing calls this directly
no test coverage detected