Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local search 首次输入无法自动、及时输出结果 #859

Closed
gukaifeng opened this issue Apr 8, 2022 · 5 comments
Closed

local search 首次输入无法自动、及时输出结果 #859

gukaifeng opened this issue Apr 8, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@gukaifeng
Copy link

I want to create a Bug report

Butterfly Information

Butterfly Version:
3.8.4

Platform:
across-platform

Browser:
all

Expected behavior

local search 输入框,输入内容后立刻显示结果,结果随输入变化而实时变化。

Actual behavior

local search 首次输入无法自动、及时输出结果,当按下退格键后,开始变得正常,但一开始不行。

Steps to reproduce the behavior

  1. 进入示例博客 https://gukaifeng.cn
  2. 点菜单栏的搜索按钮
  3. 在输入框输入任意内容
  4. 你会发现没有任何输出
  5. 当你按下退格后,一切变得正常了。

Screenshots

Website

https://gukaifeng.cn

Describe the bug

local search 首次输入无法自动、及时输出结果,当按下退格键后,开始变得正常,但一开始不行。

@jerryc127
Copy link
Owner

那是因爲你的 search.xml 還沒加載完

@gukaifeng
Copy link
Author

那是因爲你的 search.xml 還沒加載完

@jerryc127 那有没有什么办法可以快点加载?或者在打开博客的时候就开始加载,而不是点开搜索框才开始加载。

@jerryc127
Copy link
Owner

没有吧 或许把 search.xml 换成cdn

  • 或者在打开博客的时候就开始加载,而不是点开搜索框才开始加载。
    可以 自个修改代码

@jerryc127 jerryc127 added the enhancement New feature or request label Apr 10, 2022
@gukaifeng
Copy link
Author

没有吧 或许把 search.xml 换成cdn

  • 或者在打开博客的时候就开始加载,而不是点开搜索框才开始加载。
    可以 自个修改代码

@jerryc127

我的 hexo 是搭建在自己的服务器上的,不是 github page 这种,把 search.xml 换成 cdn 我感觉很难有更好的效果。

search.xml 加载慢的一个可能的原因是我的博客有点多了,现在大概有 170+ 文章,大概 30w 字。

自己改代码的话,嗯......前端这些技术其实不是我擅长的。我可以试试,但对我来说可能有点难度。

@gukaifeng
Copy link
Author

前几天比较忙,没时间搞。

刚刚改了 js,把 search.xml 改到页面加载完成时加载了,而不是原来的点开搜索按钮才加载。

现在的速度已经很好了,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants