mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-04 04:10:19 +03:00
feat:Chinese search is supported
This commit is contained in:
parent
d6eac394cf
commit
34c288de76
|
@ -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:
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user