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

最近搜索结果都变成英文了 #195

Closed
u3u opened this issue Dec 18, 2016 · 10 comments
Closed

最近搜索结果都变成英文了 #195

u3u opened this issue Dec 18, 2016 · 10 comments

Comments

@u3u
Copy link

u3u commented Dec 18, 2016

search
跳转也直接跳到 http://vuejs.org/ 之前是正常的QAQ

@Jinjiang
Copy link
Member

@yyx990803 求助 - -

@kazupon
Copy link
Member

kazupon commented Dec 19, 2016

@Jinjiang
it might be of your help.
vuejs/v2.vuejs.org#575 (comment)

@Jinjiang
Copy link
Member

@kazupon Thank you. I will update it soon :-)

@yyx990803
Copy link
Member

yyx990803 commented Dec 19, 2016

@maxiloc - we accidentally overwrote the cn site with the API key for the English version, but after reverting to the key for the Chinese index the queries are now always returning empty results. Any ideas?

@dingyiming
Copy link
Collaborator

我的错,之前从 vuejs.org 获取更新到 vuefe 改中文后,没有更改中文搜索,真抱歉

@maxiloc
Copy link
Contributor

maxiloc commented Dec 19, 2016

@yyx990803 The configuration of the crawler was still the old one so the v2 version tag did not exist. Just fixed it, should be good now.

@Jinjiang
Copy link
Member

@maxiloc It works! Thank you very much :-)

@u3u
Copy link
Author

u3u commented Dec 20, 2016

@Jinjiang 谢谢 现在恢复正常了 大家辛苦了!
对了 我还有一个建议哦 我发现搜索接口返回的 url 是绝对地址 我认为应该改成相对路径
这么做有几个好处 例如这次出现的搜索结果变成英文的问题 如果 url 是相对的 那至少影响不大
还是可以跳转过去查看 还有一个就是我发现 http://cn.vuejs.org 服务器是放在国外的 有时候访问慢
就拉了一下仓库在本地部署一个 gh-pages 服务 这样会很方便 访问速度也很快 即使没有网络的时候也能查看 不过因为搜索接口返回的 url 写死了域名 这样的话在本地浏览也会跳转到 http://cn.vuejs.org

{
  "hierarchy": {
    "lvl2": "全局 API", 
    "lvl3": null, 
    "lvl0": "API", 
    "lvl1": null, 
    "lvl6": null, 
    "lvl4": null, 
    "lvl5": null
  }, 
  "url": "http://cn.vuejs.org/v2/api/#全局-API", 
  "content": null, 
  "anchor": "全局-API", 
  "objectID": "914724202", 
  "_highlightResult": {
    "hierarchy": {
      "lvl2": {
        "value": "全局 <span class=\"algolia-docsearch-suggestion--highlight\">A</span>PI", 
        "matchLevel": "full", 
        "fullyHighlighted": false, 
        "matchedWords": [
          "a"
        ]
      }, 
      "lvl0": {
        "value": "<span class=\"algolia-docsearch-suggestion--highlight\">A</span>PI", 
        "matchLevel": "full", 
        "fullyHighlighted": false, 
        "matchedWords": [
          "a"
        ]
      }
    }, 
    "hierarchy_camel": {
      "lvl2": {
        "value": "全局 <span class=\"algolia-docsearch-suggestion--highlight\">A</span>PI", 
        "matchLevel": "full", 
        "fullyHighlighted": false, 
        "matchedWords": [
          "a"
        ]
      }, 
      "lvl0": {
        "value": "<span class=\"algolia-docsearch-suggestion--highlight\">A</span>PI", 
        "matchLevel": "full", 
        "fullyHighlighted": false, 
        "matchedWords": [
          "a"
        ]
      }
    }
  }
}

@Jinjiang
Copy link
Member

这个搜索服务是第三方提供的,本身有一定的局限性,目前这样的状态我觉得是可接受的
感谢你的建议

@wuliupo
Copy link
Contributor

wuliupo commented Jan 24, 2017

@u3u @Jinjiang
I have fixed this url issue on my localhost: replace the ajax content.
修改第三方服务返回的字符串中的url

提交代码在这里: wuliupo@b3893e6

req.responseText.replace(/cn\.vuejs\.org/g, location.hostname + ':' + location.port);

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

No branches or pull requests

7 participants