mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-05-28 06:00:40 +00:00
Explanation as a struct
This commit is contained in:
@@ -9,7 +9,6 @@ use schema::{Term, Field};
|
||||
use analyzer::SimpleTokenizer;
|
||||
use analyzer::StreamingIterator;
|
||||
use DocAddress;
|
||||
use Score;
|
||||
use query::Explanation;
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -50,13 +49,14 @@ impl Query for StandardQuery {
|
||||
fn explain(
|
||||
&self,
|
||||
searcher: &Searcher,
|
||||
doc_address: &DocAddress) -> Result<Option<(Score, Explanation)>, io::Error> {
|
||||
doc_address: &DocAddress) -> Result<Explanation, String> {
|
||||
match self {
|
||||
&StandardQuery::MultiTerm(ref q) => q.explain(searcher, doc_address)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn compute_terms(field: Field, text: &str) -> Vec<Term> {
|
||||
let tokenizer = SimpleTokenizer::new();
|
||||
let mut tokens = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user