feat:Chinese search is supported

This commit is contained in:
zedgan 2023-08-09 10:04:36 +08:00
parent d6eac394cf
commit 34c288de76
2 changed files with 2 additions and 5 deletions

View File

@ -1216,7 +1216,7 @@ components:
x-webhooks:
newPet:
post:
summary: New pet
summary: New pet 中文测试
description: Information about a new pet in the systems
operationId: newPet
tags:

View File

@ -28,8 +28,6 @@ function initEmpty() {
builder.field('description');
builder.ref('ref');
builder.pipeline.add(lunr.trimmer, lunr.stopWordFilter, lunr.stemmer);
index = new Promise(resolve => {
resolveIndex = resolve;
});
@ -38,8 +36,7 @@ function initEmpty() {
initEmpty();
const expandTerm = term => {
const token = lunr.trimmer(new lunr.Token(term, {}));
return '*' + lunr.stemmer(token) + '*';
return `*${term}*`;
};
export function add<T>(title: string, description: string, meta?: T) {