Wikipedia talk:Google Custom Search
How to do...
I couldn't understand how I was supposed to activate the custom search, so I looked in the "Edit" section, and saw the instructions, surrounded by HTML that I hadn't seen before. My question is, what should be done about this? --94knux (talk) 03:13, 27 October 2009 (UTC)
document.write is broken on Safari/Chrome. Use the importScript() DOM loaders instead. Also on Safari due to an issues with load order, at times the GSearch won't be available before it is used. —TheDJ (talk • contribs) 13:22, 27 October 2009 (UTC)
Searching in other languages
I was testing out the contextual search and noticed a usability problem. I went to Google's wiki page and searched for "search". The first page of results all pointed to Google in other languages. Could you restrict contextual search to searching within the same language? At the very least, preference should probably be given to pages in the same language. --Agilemania (talk) 13:50, 27 October 2009 (UTC)
Google Custom search gadget
- Would you be willing to support or initiate adding this feature to the gadget list of en.wikipedia.org? -- Mathias Schindler (talk) 09:11, 28 October 2009 (UTC)
- One potential problem about a specific gadget, is that if we add a Google one, before you know it, MS/Yahoo will want their own gadget too of course. I guess we could draw up some sort ruleset about this, but it certainly will require a bit of discussion. —TheDJ (talk • contribs) 23:05, 30 October 2009 (UTC)
Hi. Your scripts have a few problems. First, use importScript() to import scripts from wikipedia. Second, use importScriptURI() to import a external script (instead of document.write('<script...')). Also, I'd recommend adding the skin import to the top of each script, instead of having the user put it in their script page. ≈ MindstormsKid 00:03, 28 October 2009 (UTC)
- Yup, I agree with that. The problem with using importScript, is that the loadorder on Safari/Chrome is broken (bug 28328 and friends), so you cannot DOM include a dependency script and assume it will be loaded in order. A very annoying bug. —TheDJ (talk • contribs) 11:08, 28 October 2009 (UTC)
- This should be fixed now. it was already annoying the hell out of me. —TheDJ (talk • contribs) 13:05, 28 October 2009 (UTC)
I think I finally found a solution to this problem. This version: User:TheDJ/csewiki.js uses the google api autoload+callback method (avoiding the document.write()'s ). As a bonus, my version works for both monobook and vector, and loads the CSS by itself as well. I propose to merge User:Csewiki/monobook.js and User:Csewiki/vector.js into a single User:Csewiki/csewiki.js. —TheDJ (talk • contribs) 18:39, 29 October 2009 (UTC)
I notice the announcement on the Google blog. I am not sure this is a proper use of a Wikipedia account. Are you an official representative of Google, or a company role accounts, and are you using us to advertise your product? I'm not saying this is a bad idea; speaking personally, I may very well like it after some testing--I like most of what Google comes up with. I'm just saying that this may not be the way to do it. Please recheck WP:USER DGG ( talk ) 03:47, 28 October 2009 (UTC)
- Hi DGG, how about moving the description page (the content at User:Csewiki) to the Wikipedia name space? How about Wikipedia:Google Custom Search Gadget? -- Mathias Schindler (talk) 09:10, 28 October 2009 (UTC)
Is this the right place to comment?
- It takes a second or two for the google search box to replace the default one. If you type anything in the default box, it then gets lost (and the focus gets lost too), which is pretty annoying. Can anything be done?
- It seems that you are always taken to a search results page, rather than jumping to a page that exactly matches your query. I guess this is intentional to behave more like google, and less like wikipedia. But a way to get the old behaviour back would be good. Stevage 05:02, 28 October 2009 (UTC)
- Hi Stevage, I'm not sure I understand your proposal for exact matches. For instance, on the DNA article, we don't necessarily want to go to the Wikipedia article on Sequences for a "sequence" query; we might want to look at the contextual on- and off-domain results first (as well as other wikipedia articles related to sequences). If there is exactly one Wikipedia result in the first tab, and none at all in the 2nd and 3rd tabs, then it might make sense to jump. Even then the user might just be checking stuff out, to see what's available, but now we're down to "when in Rome...", and I can't speak for wikipedia users in general. (Is this last case the one for which you would prefer to see different behavior?
- I don't yet know anything about wikipedia widgets, but if they are configurable then this could be a configuration option. talk) Komarek (talk) 22:17, 30 October 2009 (UTC)
- Hmm, couldn't make much sense of your answer, other than "no, because...context!" But here's an example, I searched for "CX". There's an article CX, yet it didn't even feature on the first page of results. Seriously, if there's a page that matches the query exactly, that should always be the first hit. I don't see what "context" has to do with it. Even if I'm at the DNA article, like you suggest, and I search for "sequence", my search might be completely unrelated to where I am. Not having a guaranteed way of getting to sequence is very frustrating. Stevage 10:16, 6 November 2009 (UTC)
I'm proposing the following changes:
- Move User:Csewiki/monobook.css to User:Csewiki/csewiki.css. The CSS for monobook and vector is the same, so no need for 2 pages.
- Delete User:Csewiki/monobook.css and User:Csewiki/vector.css (this has no consequence for people that currently load this page.
- Deploy my changes User:TheDJ/csewiki.js in User:Csewiki/monobook.js. Makes it work on Safari/Chrome using autoloading and a callback, as well as some smaller style cleanup.
- Merge the current User:Csewiki/monobook.js and User:Csewiki/vector.js
- Move User:Csewiki/monobook.js to User:Csewiki/csewiki.js or go for a Gadget straightaway (will avoid even more redirects if it does become a gadget)
- Make User:Csewiki/monobook.js and User:Csewiki/vector.js importScript() calls for csewiki.js, for backward compatibility.
- Thank you very much for proposing and implementing the changes. -- Mathias Schindler (talk) 12:18, 3 November 2009 (UTC)
This is a neat experiment, but it still has some bugs that are going to be hard to get used to.
- 1) the old WP searchbar used to default to "I'm feeling lucky" functionality. You type "Dog," hit enter, and you go to the page for Dog. No longer.
- 2) A search for "user:Csewiki" is ineffectual. A search for "wp:citation needed" is also ineffectual (the first few hits are not wp:citation needed).
If this were an amateur's volunteer project, my praise would be profuse; but I see this is being advertised as a google product (that's how I found it). It's rather bizarre that Google would release a product with such crippling bugs.
I'm going to uninstall this thing for now, but I'll keep this page on my watchlist, and I'll re-install it if these bugs get addressed. Thanks for the great work. Andrew Gradman talk/WP:Hornbook 20:32, 1 November 2009 (UTC)
In other chapter
Hello, I have imported sucessfully the script in fr:wp as it was detailed in earlier version of the help guide . It worked fine until yesterday, when a change was probably made here that prevents the script to load. Is there a way to reactivate it for wp other than en as I became used to it? Thanks. Moez talk 16:50, 14 November 2009 (UTC)
- hmm, it seems to be working again as of now. Disregard this message. Moez talk 17:06, 14 November 2009 (UTC)
Problems with the script
I tried to live with it, but on the whole I'm finding the disappearance of my 'go' button virtually impossible to handle.
The problem is that there's no longer any way to go to a particular encyclopedia page, usually when I doing a search for it doesn't bring up the right page.
I don't think add-on is working right now, because it breaks this existing (and in an encyclopedia essential) functionality.-18:33, 25 November 2009 (UTC)