mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
fix: Make sure to compute the right word index
This commit is contained in:
parent
0ce08c8790
commit
b406fb4aed
@ -60,12 +60,11 @@ fn main() {
|
|||||||
|
|
||||||
let product: Product = from_str(&line).unwrap();
|
let product: Product = from_str(&line).unwrap();
|
||||||
|
|
||||||
let title = iter::repeat(0).zip(product.title.split_whitespace()).enumerate();
|
let title = iter::repeat(0).zip(product.title.split_whitespace()).filter(|&(_, w)| !common_words.contains(w)).enumerate();
|
||||||
let description = iter::repeat(1).zip(product.ft.split_whitespace()).enumerate();
|
let description = iter::repeat(1).zip(product.ft.split_whitespace()).filter(|&(_, w)| !common_words.contains(w)).enumerate();
|
||||||
|
|
||||||
let words = title.chain(description);
|
let words = title.chain(description);
|
||||||
for (i, (attr, word)) in words {
|
for (i, (attr, word)) in words {
|
||||||
if common_words.contains(word) { continue }
|
|
||||||
let doc_index = DocIndex {
|
let doc_index = DocIndex {
|
||||||
document: product.product_id,
|
document: product.product_id,
|
||||||
attribute: attr,
|
attribute: attr,
|
||||||
|
Loading…
Reference in New Issue
Block a user