Skip to content

Commit 945765c

Browse files
authored
spi-search: optimize splite strategy (#756)
1 parent 9af69d3 commit 945765c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

backend/spi/spi-search/src/serv/pg/search_pg_item_serv.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub async fn add(add_req: &mut SearchItemAddReq, funs: &TardisFunsInst, ctx: &Ta
4444
"{} {} {} {}",
4545
add_req.title.as_str(),
4646
pinyin_vec.clone().into_iter().map(|pinyin| pinyin.chars().next().unwrap_or_default()).join(""),
47-
generate_word_combinations_with_symbol(content, vec!["-", "_"]).join(" "),
47+
generate_word_combinations_with_symbol(add_req.title.as_str(), vec!["-", "_"]).join(" "),
4848
generate_word_combinations(pinyin_vec).join(" ")
4949
)));
5050
} else {
@@ -55,7 +55,7 @@ pub async fn add(add_req: &mut SearchItemAddReq, funs: &TardisFunsInst, ctx: &Ta
5555
generate_word_combinations_with_length(content, 1).join(" "),
5656
generate_word_combinations_with_length(content, 2).join(" "),
5757
generate_word_combinations_with_length(content, 3).join(" "),
58-
generate_word_combinations_with_symbol(content, vec!["-", "_"]).join(" "),
58+
generate_word_combinations_with_symbol(add_req.title.as_str(), vec!["-", "_"]).join(" "),
5959
generate_word_combinations(pinyin_vec).join(" ")
6060
)));
6161
}
@@ -133,7 +133,7 @@ pub async fn modify(tag: &str, key: &str, modify_req: &mut SearchItemModifyReq,
133133
"{} {} {} {}",
134134
title,
135135
pinyin_vec.clone().into_iter().map(|pinyin| pinyin.chars().next().unwrap_or_default()).join(""),
136-
generate_word_combinations_with_symbol(content, vec!["-", "_"]).join(" "),
136+
generate_word_combinations_with_symbol(title.as_str(), vec!["-", "_"]).join(" "),
137137
generate_word_combinations(pinyin_vec).join(" ")
138138
)));
139139
} else {
@@ -144,7 +144,7 @@ pub async fn modify(tag: &str, key: &str, modify_req: &mut SearchItemModifyReq,
144144
generate_word_combinations_with_length(content, 1).join(" "),
145145
generate_word_combinations_with_length(content, 2).join(" "),
146146
generate_word_combinations_with_length(content, 3).join(" "),
147-
generate_word_combinations_with_symbol(content, vec!["-", "_"]).join(" "),
147+
generate_word_combinations_with_symbol(title.as_str(), vec!["-", "_"]).join(" "),
148148
generate_word_combinations(pinyin_vec).join(" ")
149149
)));
150150
}

0 commit comments

Comments
 (0)