elastic: update problemId token

This commit is contained in:
undefined committed 2022-09-09 09:43:31 +08:00
1 parent 920b7c9b63
commit 333b96f34c
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/elastic-search", "name": "@hydrooj/elastic-search",
"version": "1.0.7", "version": "1.0.8",
"main": "package.json", "main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro", "repository": "https://github.com/hydro-dev/Hydro",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
+2 -2
View File
@@ -16,10 +16,10 @@ const processDocument = (doc: Partial<ProblemDoc>) => {
} }
if (doc.title) { if (doc.title) {
doc.title = doc.title.replace(/[[\]【】()()]/g, ' ') doc.title = doc.title.replace(/[[\]【】()()]/g, ' ')
.replace(/([a-zA-Z]{2,})/, (a) => `${a} `); .replace(/([a-zA-Z]{2,})(\d+)/, '$1$2 $1 $2');
} }
if (doc.pid) { if (doc.pid) {
doc.pid = doc.pid.replace(/([a-zA-Z]{2,})/, (a) => `${a} `); doc.pid = doc.pid.replace(/([a-zA-Z]{2,})(\d+)/, '$1$2 $1 $2');
} }
return omit(doc, indexOmit); return omit(doc, indexOmit);
}; };