MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / search

Method search

nodedb/src/engine/sparse/inverted/search.rs:116–135  ·  view source on GitHub ↗

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>,
   

Source from the content-addressed store, hash-verified

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 ///

Callers 6

index_and_searchFunction · 0.45
search_with_stemmingFunction · 0.45
fuzzy_searchFunction · 0.45
remove_documentFunction · 0.45
empty_queryFunction · 0.45
collections_isolatedFunction · 0.45

Calls 1

as_u64Method · 0.45

Tested by 6

index_and_searchFunction · 0.36
search_with_stemmingFunction · 0.36
fuzzy_searchFunction · 0.36
remove_documentFunction · 0.36
empty_queryFunction · 0.36
collections_isolatedFunction · 0.36