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:
|
x-webhooks:
|
||||||
newPet:
|
newPet:
|
||||||
post:
|
post:
|
||||||
summary: New pet
|
summary: New pet 中文测试
|
||||||
description: Information about a new pet in the systems
|
description: Information about a new pet in the systems
|
||||||
operationId: newPet
|
operationId: newPet
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -28,8 +28,6 @@ function initEmpty() {
|
||||||
builder.field('description');
|
builder.field('description');
|
||||||
builder.ref('ref');
|
builder.ref('ref');
|
||||||
|
|
||||||
builder.pipeline.add(lunr.trimmer, lunr.stopWordFilter, lunr.stemmer);
|
|
||||||
|
|
||||||
index = new Promise(resolve => {
|
index = new Promise(resolve => {
|
||||||
resolveIndex = resolve;
|
resolveIndex = resolve;
|
||||||
});
|
});
|
||||||
|
@ -38,8 +36,7 @@ function initEmpty() {
|
||||||
initEmpty();
|
initEmpty();
|
||||||
|
|
||||||
const expandTerm = term => {
|
const expandTerm = term => {
|
||||||
const token = lunr.trimmer(new lunr.Token(term, {}));
|
return `*${term}*`;
|
||||||
return '*' + lunr.stemmer(token) + '*';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export function add<T>(title: string, description: string, meta?: T) {
|
export function add<T>(title: string, description: string, meta?: T) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user