()
| 23 | |
| 24 | #[test] |
| 25 | fn index_and_search() { |
| 26 | let (idx, _dir) = open_temp(); |
| 27 | idx.index_document( |
| 28 | T, |
| 29 | "docs", |
| 30 | Surrogate::new(1), |
| 31 | "The quick brown fox jumps over the lazy dog", |
| 32 | ) |
| 33 | .unwrap(); |
| 34 | idx.index_document( |
| 35 | T, |
| 36 | "docs", |
| 37 | Surrogate::new(2), |
| 38 | "A fast brown dog runs across the field", |
| 39 | ) |
| 40 | .unwrap(); |
| 41 | idx.index_document( |
| 42 | T, |
| 43 | "docs", |
| 44 | Surrogate::new(3), |
| 45 | "Rust programming language for systems", |
| 46 | ) |
| 47 | .unwrap(); |
| 48 | |
| 49 | let results = idx.search(T, "docs", "brown fox", 10, false, None).unwrap(); |
| 50 | assert!(!results.is_empty()); |
| 51 | assert_eq!(results[0].doc_id, Surrogate::new(1)); |
| 52 | } |
| 53 | |
| 54 | #[test] |
| 55 | fn search_with_stemming() { |
nothing calls this directly
no test coverage detected