Last modified: 2011-03-13 18:06:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T16139, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14139 - Autocomplete should not kick in till at least 2 characters
Autocomplete should not kick in till at least 2 characters
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Search (Other open bugs)
1.13.x
All All
: Lowest enhancement with 1 vote (vote)
: ---
Assigned To: Robert Stojnic
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-15 16:28 UTC by paul irish
Modified: 2011-03-13 18:06 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description paul irish 2008-05-15 16:28:08 UTC
To preserve apparent responsiveness and deliver the most relevant results quickly, I suggest that the search suggest functionality shouldn't make an ajax call until there are at least two characters already typed in the box.

Fix

Line 481 of mwsuggest.js:
os_fetchResults(r,query,os_search_timeout);
becomes:
if (query.length>=2) os_fetchResults(r,query,os_search_timeout);



Btw- more best practices here: http://developer.yahoo.com/ypatterns/pattern.php?pattern=autocomplete
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-05-15 16:31:21 UTC
An unusual first character such as ! or, I don't know, γ (on, say, enwiki) can return meaningful results without a second one being provided.
Comment 2 Brion Vibber 2008-05-15 16:41:04 UTC
Agreed; consider also CJK, where one Unicode character may carry significantly more information.
Comment 3 Craig 2008-05-15 21:45:52 UTC
I agree with paul irish that searching shouldn't start until the 2nd character is entered into the search box, but I do see the point about CJK. Perhaps a solution like the following filter being run on the client side would work:

if (query.length >=2 && ! query.match(/[A-Za-z]/))

That would still execute the search after the first character for CJK languages, greek characters, !'s, and all those other non-Latin letters.
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-05-15 22:32:02 UTC
I think you meant || there, not &&.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links