Search the inverted index using BM25 scoring. Supports `NOT ` and `- ` negation in the query string. Returns `Err` for invalid queries (NOT-only, unsupported parentheses).
(
&self,
tid: TenantId,
collection: &str,
query: &str,
top_k: usize,
fuzzy_enabled: bool,
prefilter: Option<&nodedb_types::SurrogateBitmap>,
| 114 | /// Supports `NOT <term>` and `-<term>` negation in the query string. |
| 115 | /// Returns `Err` for invalid queries (NOT-only, unsupported parentheses). |
| 116 | pub fn search( |
| 117 | &self, |
| 118 | tid: TenantId, |
| 119 | collection: &str, |
| 120 | query: &str, |
| 121 | top_k: usize, |
| 122 | fuzzy_enabled: bool, |
| 123 | prefilter: Option<&nodedb_types::SurrogateBitmap>, |
| 124 | ) -> crate::Result<Vec<TextSearchResult>> { |
| 125 | self.inner |
| 126 | .search( |
| 127 | tid.as_u64(), |
| 128 | collection, |
| 129 | query, |
| 130 | top_k, |
| 131 | fuzzy_enabled, |
| 132 | prefilter, |
| 133 | ) |
| 134 | .map_err(fts_index_err) |
| 135 | } |
| 136 | |
| 137 | /// Search with explicit boolean mode (AND or OR). |
| 138 | /// |