Update search_kws rule for tantivy

This commit is contained in:
2026-06-23 08:30:07 +08:00
parent 8f8d12a5e7
commit 333f2cff43

View File

@@ -207,7 +207,10 @@ export class HighlightedMarkdown extends Component {
['nickname', NICKNAME_RE],
];
if (props.search_param) {
let search_kws = props.search_param.split(' ').filter((s) => !!s);
let search_kws = props.search_param
.split(/[\s()+-]+/)
.filter((s) => s && s !== 'AND' && s !== 'OR');
if (search_kws.length) {
rules.push([
'search',
new RegExp(
@@ -218,6 +221,7 @@ export class HighlightedMarkdown extends Component {
),
]);
}
}
const splitted = split_text(originalText, rules);
return (