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

Search feature is broken on some non-English pages #1384

Closed
meisyal opened this issue May 8, 2016 · 3 comments · Fixed by #3255
Closed

Search feature is broken on some non-English pages #1384

meisyal opened this issue May 8, 2016 · 3 comments · Fixed by #3255

Comments

@meisyal
Copy link
Contributor

meisyal commented May 8, 2016

Reporting that search feature is broken on some non-English pages. This is what I have done. I tried to search something using Google custom search on Bahasa Indonesia page, the search result gave this following error:

  1. That’s an error.
    Your client does not have permission to get URL /cse?q=&ie=UTF-8&sa=Cari from this server. (Client IP address: 114.79.61.92)
    Requests without cx/cref are no longer supported That’s all we know.

The same error occurred on these language pages below:

  • Bulgarian
  • German
  • Spanish
  • Italian
  • Korean
  • Polish
  • Portuguese
  • Russian
  • Turkish
  • Vietnamese
  • Mandarin Chinese
  • Taiwanese Mandarin

The other pages have no problem.

@stomar
Copy link
Contributor

stomar commented May 8, 2016

Thanks for investigating!

cx seems to be the Google custom search engine ID. For a few languages (namely de, en, fr, ja) it's defined in _config.yml as cx_id property, but for most it's not, and at least for de it seems to be invalid.

I do not know yet how to get proper values for all langs.

@vtamara
Copy link
Contributor

vtamara commented May 20, 2024

When I try to search from the spanish page it presents the following page:
image

I notice that searching words in spanish in the english page works:
image

What about using the cx_id of the page in english for other languages?

If it doesn´t break anything I can try that for spanish.

For english I notice that its cx_id is defined in the _data/locales/en.yml file as:

search:                                                                        
  text: Search                                                                 
  cx_id: '013598269713424429640:g5orptiw95w'

While the spanish file _data/locale/es.yml says just:

search:
  text: Buscar

vtamara added a commit to vtamara/www.ruby-lang.org that referenced this issue May 20, 2024
vtamara added a commit to vtamara/www.ruby-lang.org that referenced this issue May 23, 2024
…s cx_id of english --that will also search in other languages. Closes ruby#1384
@vtamara
Copy link
Contributor

vtamara commented May 23, 2024

In the deployed pages in spanish, I see that search now is working.

I think it could work to use the english cx_id as default for languages that don´t have it.

I notice that _layouts/default.html that is used as base for other layouts includes _includes/search.html that starts with:

{% if site.data.locales[page.lang].search %}                                                                                                                    
  {% assign cx_id = site.data.locales[page.lang].search.cx_id %}                                                                                                
  {% assign text = site.data.locales[page.lang].search.text %}                                                                                                  
{% else %}                                                                                                                                                      
  {% assign text = site.data.locales['en'].search.text %}                                                                                                       
{% endif%}   

IMHO it can be more specific for search.text and there can be a similar test for search.cx_id

hsbt pushed a commit that referenced this issue May 24, 2024
…s cx_id of english --that will also search in other languages. Closes #1384
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants