Lexical coverage gate for matching; fix demo false positive
This commit is contained in:
+9
-2
@@ -310,7 +310,9 @@ impl Node {
|
||||
let max = max_results.unwrap_or(self.config.query.max_results).max(1);
|
||||
let query = QueryBody::new(text, max);
|
||||
let qid = query.qid.clone();
|
||||
let (local_hits, local_total) = self.index.search(text, max, false)?;
|
||||
let (local_hits, local_total) =
|
||||
self.index
|
||||
.search_with_coverage(text, max, false, self.config.matching.min_coverage)?;
|
||||
let local_items = response_items(&local_hits);
|
||||
let mut responses = Vec::new();
|
||||
if network {
|
||||
@@ -560,7 +562,12 @@ impl Node {
|
||||
|
||||
async fn respond(&self, query: &QueryBody, querier: &str, relay: &str) -> Result<()> {
|
||||
let max = query.budget.max_results.clamp(1, 1000);
|
||||
let (hits, total) = self.index.search(&query.text, max, true)?;
|
||||
let (hits, total) = self.index.search_with_coverage(
|
||||
&query.text,
|
||||
max,
|
||||
true,
|
||||
self.config.matching.min_coverage,
|
||||
)?;
|
||||
if hits.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user