Skip to content

docsify.search.index引发的问题及建议 #486

Closed
@Ablegang

Description

@Ablegang

因为搜索的相关信息存储到了Local Storage,并且一个域名只有一个docsify.search.index。

当一个域名下,部署两个不相关的文档时,则会出现搜索结果不符合预期的问题。

如,当我打开http://aaa.com/docs/test 此时建立了docsify.search.index ,再打开 http://aaa.com/docs/test2 ,搜索的就是test的内容,想搜索test2特有的内容,就会出现无结果。

docsify的官网文档,搜索npm,也会出现不同语言的结果。

我建议,存储Local Storage的时候,可以按basePath来存储,就不会重复了。

在现在一个域名共享一个docsify.search.index的情况下,我的做法是设置search加上maxAge参数为100,缩短它的缓存周期。

但,这也牺牲了缓存功能。

Metadata

Metadata

Assignees

Labels

bugconfirmed as a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions