Issue/1070 (#1071)

Add a boolean flag in the Query::query_terms informing on whether
position information is required.

Closes #1070
This commit is contained in:
Paul Masurel
2021-06-03 22:33:20 +09:00
committed by GitHub
parent 2aad0ced77
commit 6e4b61154f
10 changed files with 83 additions and 81 deletions

View File

@@ -5,7 +5,7 @@ use crate::query::{Explanation, Query};
use crate::schema::IndexRecordOption;
use crate::Searcher;
use crate::Term;
use std::collections::BTreeSet;
use std::collections::BTreeMap;
use std::fmt;
/// A Term query matches all of the documents
@@ -127,7 +127,7 @@ impl Query for TermQuery {
self.specialized_weight(searcher, scoring_enabled)?,
))
}
fn query_terms(&self, term_set: &mut BTreeSet<Term>) {
term_set.insert(self.term.clone());
fn query_terms(&self, terms: &mut BTreeMap<Term, bool>) {
terms.insert(self.term.clone(), false);
}
}