clear-code/rurema-search

るりまサーチのAPIの返すURLがおかしい?

Closed this issue · 1 comments

pocke commented

るりまサーチのAPIを試していたのですが、返してくるURLがおかしいようです。

次のようにcurlとjqをつかってURLを取り出してみると、https://docs.ruby-lang.org/ja/search/の後に、本来の検索結果のURLがついてきているようにみえます。また、検索結果のURLのスキーマがhttpsではなくhttpになっているので、httpsの方がより良さそうです。

$ curl -s 'https://docs.ruby-lang.org/ja/search/api:v1/query:open/' | jq '.entries[0].documents[0].url' 
"https://docs.ruby-lang.org/ja/search/http://docs.ruby-lang.org/ja/2.3.0/library/open=2duri.html"

期待するURL: https://docs.ruby-lang.org/ja/2.3.0/library/open=2duri.html
実際のURL: https://docs.ruby-lang.org/ja/search/http://docs.ruby-lang.org/ja/2.3.0/library/open=2duri.html


便利なプロダクトをありがとうございます🙏

kou commented

rurema.clear-code.comだとおかしくないのでデプロイの仕方の問題な気がします。

% curl -s 'http://rurema.clear-code.com/api:v1/query:open/' | jq '.entries[0].documents[0].url'
"http://rurema.clear-code.com/2.1.0/library/open=2duri.html"

docs.ruby-lang.orgではリバースプロキシをしたりしているはずなのでそのあたりの設定にhttp://なままのやつが混ざっているのかもしれません。

https://github.com/ruby/docs.ruby-lang.org に報告してもらえますか?