mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 21:20:24 +01:00
restore synonyms tests
This commit is contained in:
parent
db64e19b8d
commit
a7c88c7951
@ -882,7 +882,6 @@ mod tests {
|
|||||||
|
|
||||||
// even try to search for a document
|
// even try to search for a document
|
||||||
let reader = db.main_read_txn().unwrap();
|
let reader = db.main_read_txn().unwrap();
|
||||||
println!("here");
|
|
||||||
let SortResult {documents, .. } = index.query_builder().query(&reader, Some("21 "), 0..20).unwrap();
|
let SortResult {documents, .. } = index.query_builder().query(&reader, Some("21 "), 0..20).unwrap();
|
||||||
assert_matches!(documents.len(), 1);
|
assert_matches!(documents.len(), 1);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -147,17 +147,17 @@ fn process_tokens<'a>(tokens: impl Iterator<Item = Token<'a>>) -> impl Iterator<
|
|||||||
match token.kind {
|
match token.kind {
|
||||||
TokenKind::Word | TokenKind::StopWord | TokenKind::Any => {
|
TokenKind::Word | TokenKind::StopWord | TokenKind::Any => {
|
||||||
*offset += match *sepkind {
|
*offset += match *sepkind {
|
||||||
Some(SeparatorKind::Hard) => 8,
|
Some(TokenKind::Separator(SeparatorKind::Hard)) => 8,
|
||||||
Some(SeparatorKind::Soft) => 1,
|
Some(_) => 1,
|
||||||
None => 0,
|
None => 0,
|
||||||
};
|
};
|
||||||
*sepkind = None;
|
*sepkind = Some(token.kind)
|
||||||
}
|
}
|
||||||
TokenKind::Separator(SeparatorKind::Hard) => {
|
TokenKind::Separator(SeparatorKind::Hard) => {
|
||||||
*sepkind = Some(SeparatorKind::Hard);
|
*sepkind = Some(token.kind);
|
||||||
}
|
}
|
||||||
TokenKind::Separator(SeparatorKind::Soft) if sepkind.is_none() => {
|
TokenKind::Separator(SeparatorKind::Soft) if sepkind.is_none() => {
|
||||||
*sepkind = Some(SeparatorKind::Soft);
|
*sepkind = Some(token.kind);
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user