r89900 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89899‎ | r89900 | r89901 >
Date:23:13, 11 June 2011
Author:wikinaut
Status:ok (Comments)
Tags:
Comment:
expressly set opensearch limit. Found a reproducible problem that on a large wiki a few case-insensitive matches were not shown when limit was not set to a meaningful value. But api.php has been found working by testing that via manual call from url. Perhaps a jQuery problem. Set limit to an value solved that problem immediately.
Modified paths:
  • /trunk/extensions/Vector/modules/ext.vector.simpleSearch.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Vector/modules/ext.vector.simpleSearch.js
@@ -48,6 +48,7 @@
4949 data: {
5050 action: 'opensearch',
5151 search: query,
 52+ limit: 10,
5253 namespace: 0,
5354 suggest: ''
5455 },

Follow-up revisions

RevisionCommit summaryAuthorDate
r89950do not sent api requests for empty inputs, e.g. after a character input follo...wikinaut08:41, 13 June 2011

Comments

#Comment by Krinkle (talk | contribs)   23:47, 11 June 2011

Could you link to the api results of those problem cases ? Interesting problem.

#Comment by Wikinaut (talk | contribs)   04:06, 12 June 2011

I could (now) not immediately reproduce the problem, but can try again later (tomorrow+), as I did only change and reverted this line. (Yes, of course, I always clear the browsers cache after changing the javascsript. Setting the limit=1 is a good test while debugging this, to see, whether the correct script is actually used as wanted.)

The api call which I tested before committing this code change was http://server/phase3/api.php?action=opensearch&search=ev&namespace=0&format=jsonfm api output was like expected ["ev",["EVL","EVL-Redesign"]]

I could not detect any problem in api.php.

Just to remind you: I observed that:

when I entered in the search box (main page) the correct case page names "EV" -> 2 suggestions "ev" -> 0 Suggestions (wrong) (*)

After adding limit=10 I got "EV" -> 2 suggestions "ev" -> 2 Suggestions (correct)

Changing back gave the same as (*)


  • Do you want me to open a bugzilla with links to this revision in order to further track this problem?
#Comment by Catrope (talk | contribs)   04:46, 12 June 2011

Please do, this'd be a bug in the API module. Wondering if TitleKey isn't triggered if there's no limit, or something.

#Comment by Wikinaut (talk | contribs)   04:21, 12 June 2011

additional info:

  • PHP 5.2.6 (apache2handler) - with Suhosin v0.9.27 (I later could check other versions, with or without patch)
  • Wiki has Content pages 2,607
  • Pages (All pages in the wiki, including talk pages, redirects, etc.) 10,382
  • I will scrutinize the apache (access, error) around the time of the problem and fixing and system log files - I can access them.
#Comment by Wikinaut (talk | contribs)   08:43, 13 June 2011

updates:

  • javascript did not alone causes this problem
  • appear to be an API problem, analysis will follow
  • PHP version does not matter, same problem under PHP 5.3.6 w/o Suhosin patch
  • Wiki size does not matter
  • bugzilla will follow soon
  • observed the apache log and detected that suggestions are asked for empty searches (...&search=&...). In other words, the api interface is called for val()=="" . This is a useless request and should be avoided in the javascript by checking empty inputs.
  • How empty input are induced? Type "a" (triggers -> ajax). type backspace to clear your "a" (-> triggers ajax with empty input value)

---> see follow up 89950

#Comment by Wikinaut (talk | contribs)   09:12, 13 June 2011

filed bug29370 for tracking

Status & tagging log