Page MenuHomePhabricator

Searches less than 4 characters long don't work
Closed, ResolvedPublic

Description

Author: henry.cocozzoli

Description:
Search for "files". Get a list of docs.
Search for "JPG". Get no list, even if it appears on previous search.

Wiki running on Ubuntu Linux 6.06 LTS
MediaWiki: 1.8.2 (r14403)
PHP: 5.1.2 (apache2handler)
MySQL: 5.0.22-Debian_0ubuntu6.06.2-log
visited from 134.244.170.207
Retrieved from "http://calvin/wiki/index.php/Special:Version"

Accessed from Win XP SP2 IE 6 or 7.


Version: 1.8.x
Severity: normal
OS: Linux
Platform: Other

Details

Reference
bz7726

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:23 PM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz7726.
  • Bug 13423 has been marked as a duplicate of this bug. ***

Reopening this...

We could work around this by applying a transformation on input to bypass the server-wide length limit. Lame perhaps, but at least it would make things work for people. :)

Created attachment 5477
Proposed patch

Proposed patch.

Also cleans up the use of /e modifier (which isn't allowed in new code at the moment) for the rest of the function in question, splitting out into callback functions.

Essentially, it just prefixes any words 4 chars or shorter with 'SMALL', bringing them above the threshold.

We might want to consider looking for certain 'stop' words and disallowing those regardless...

Attached:

Fixed in r43920 -- Short words are padded so they now get indexed. Yay!

Adapted part of Werdna's patch, with some additional cleanup:

  • Using 'U00' to pad instead of 'SMALL' to reduce false positives (eg search for "small*" could match "Smallville" and "SMALLc")
  • Checking server's ft_min_word_len variable to see if we need to do anything. This preserves index compatibility with existing installations which have customized their index length.
  • Some further cleanup on redundant code -- just toss everything through lc() and be done with it :D
  • Cleaned out some more evals in zh and yue classes :P
  • Fixed yue class to call the parent adjustor properly

ayg wrote:

The fix for this seems to have caused bug 17733.