|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48726 website search results ignores language preference
Submitted: 2009-06-29 20:33 UTC Modified: 2021-04-22 12:04 UTC
Avg. Score:2.6 ± 2.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: arlo at arlomedia dot com Assigned:
Status: Verified Package: Website problem
PHP Version: Irrelevant OS: Mac OS 10.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: arlo at arlomedia dot com
New email:
PHP Version: OS:


 [2009-06-29 20:33 UTC] arlo at arlomedia dot com
Often when I search the online documentation at, the search 
results include multiple entries for the same page in different 
languages. These are essential duplicate results that make the search 
results less useful. I would rather just see pages from my selected 
language (which is already sent to the search script from the search 

Reproduce code:
I entered "class constants" into the search field and selected "online documentation". This led to this URL:

The first eight results are the same page in eight different languages. After the first page, I see a variety of other results, but they are offered in different languages seemingly at random.

Expected result:
Since I'm using the English version of the manual, I would expect to see 
only English results.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-29 20:34 UTC] arlo at arlomedia dot com
Second sentence should have said "these are essentially duplicate 
results," not "essential duplicate results."
 [2009-06-29 23:28 UTC]
This is due to the way in which Yahoo! - like all of the major search 
engines - spiders and catalogs the data.  The site-wide search on the 
PHP website is powered by Yahoo!'s search engine.  Of course, as such, 
you can use Yahoo!'s search operators, meta words, etc. (see for more 
information), but as far as changing the method in which this is handled 
(i.e. - switching from Yahoo!), I'm not so sure it's planned for the 
foreseeable future.
 [2009-06-30 01:37 UTC] arlo at arlomedia dot com
Thanks for considering. I don't know what setup options Yahoo gives you 
for its search tool, but here are two ideas that might be worth a look:

- The Yahoo search is configured for a starting directory of Is this an argument that passes to Yahoo with 
every search query? If so, the argument could be extended to include the 
language code, like

- The Yahoo search tips page you mentioned above includes an option 
"inurl". When I tried this on, I was able to limit the search 
results to English by including inurl:/en/ in my search terms. 
501&fr2=sb-top&sao=1) The site interpreted this as a literal 
string when I entered it into the search box there. But if the search 
script on  automatically added this when it sent the query to 
Yahoo, would Yahoo handle it as it does on its own site?
 [2009-06-30 07:48 UTC]
What I don't understand is why the language detection isn't working, we are explicitly asking for the language you provide (falling back to english if none).

I'd rather try to fix the language detection then to muck around with dirty quickfixes by limiting the search range based on path structure.

 [2009-06-30 09:44 UTC]
Hannes, is it possible to log the actual requests to make sure the 
language _IS_ being supplied correctly?

 [2009-06-30 17:18 UTC] arlo at arlomedia dot com
I only suggested a "dirty quickfix" because I was told the functionality 
of the Yahoo engine was beyond your control. If in fact it supports 
language filtering, then yes, it would be good to fix that.

I just noticed that when I perform a search of the online documentation, 
my language code of "en" appears as an argument in the search result 

...and this has no effect on the search results. However, if I change 
the language code in the URL to es, hu, ru ... then the search results 
are correctly filtered by that language. Apparently it is only the 
default language of en that is being ignored.
 [2009-09-17 02:31 UTC] FDSFS at DFDSF dot COM
 [2014-08-14 05:24 UTC]
Ironically, this was fixed long ago but the bug has reoccurred now that we are using Google.
 [2014-12-30 21:08 UTC]
Can confirm this is still an issue (tested with 'de' and 'en').

(Additonal) Steps to reproduce:

- Navigate to
- Results for 'en' strpos documentation and 'de' strpos documentation will be 
- Navigate to
- Results for 'de' strpos documentation and 'en' strpos documentation will be 
 [2021-04-22 12:04 UTC]
I think this is caused by the accept-language header of the user's
browser.  It might not be the best idea to use a third party
search at all, though, for privacy reasons.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 02:01:35 2024 UTC