On Sep 24, 2012, at 12:40 AM, Sherif Ramadan wrote: > On Mon, Sep 24, 2012 at 1:45 AM, Per Jessen <[email protected]> wrote: >> Hi, >> >> I've been keeping a local mirror of the php website for a few years now, has >> always worked well. Recently though I've noticed the following: >> >> When I do search in the Function List for e.g. "base64", I am presented with >> a list of hits, presumably ordered by quality. The problem is - those hits >> link to pages on "php.net", not on my local site. >> >> The same behaviour is also evident on official php mirrors - go to >> ch.php.net and do the search for base64. The list of hits has links to >> php.net, not ch.php.net. >>
> Actually, you bring up a good point. The search API has recently > changed since it went from Bing to Google. It appears to me that the > search feature depends on the old Bing code when it's doing the > request on the backend. I'm not entirely clear on how the new Google > search is being used, but I suspect it has something to do with this > code https://github.com/php/web-php/blob/master/results.php#L45 and > probably due to it not returning results as $MYSITE instead of > www.php.net in the absolute URI. The Google search code (CSE) is simple and generic. It does not perform mirror specific searches and instead prints the results from the CSE so all old code (like $MYSITE) is ignored. I added the CSE without touching/cleaning the old code (in a panic as our search died when Bing pulled the plug) so understand why it's all confusing. Basically, we just pass in the query to the CSE JavaScript and it handles the rest. https://github.com/php/web-php/blob/master/include/prepend.inc#L195 It appears we cannot tweak the results with the free version of the CSE but the paid version does allow it. Or maybe we can somehow tweak it (the spec offers a lot of options) but note that we have different searches like bugs links go to bugs.php.net, pecl to pecl.php.net, etc. so it can't be a global change. https://www.google.com/cse/docs/ Lastly, the "www.php.net" code above exists as once upon a time we had all search traffic go through that server. It passes in the mirror (notice the &mirror= there) so returned links did work correctly but now that code isn't used. Regards, Philip -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
