Page MenuHomePhabricator

search doesn't return results when there is more than one match
Closed, DeclinedPublic

Description

Author: mevdschee

Description:
The search doesn't return results when there is more than one match. I changed
the code in line 329-330 of includes/SearchEngine.php from:

$cond .= " (MATCH (field) AGAINST ('" .wfStrencode( $word ). "'))";

to:

$cond .= " (field REGEXP '[[:<:]]".wfStrencode( $word )."[[:>:]]')";

Now it works as expected. Just wanted to share this.

Context: Redhat 9 default installation with apache and mysql.


Version: 1.3.x
Severity: major
OS: Linux
Platform: PC
URL: http://www.io.tudelft.nl/id/mediawiki

Details

Reference
bz811

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 7:03 PM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz811.
bzimport added a subscriber: Unknown Object (MLST).

What does "more than one match" mean? What are the actual results? What
are you testing with? Can you confirm that the search index is correct? Are
the terms too short for the search index?

If you do this, your search will be *incredibly* slow since it will scan the
entire database's text, entry by entry, on every search.

The sample search term provided via e-mail works fine after addition of a third page to the
wiki so that term was not automatically discarded as uninformative (present in 50% of the
search database).

epriestley changed the task status from Declined to Resolved by committing Unknown Object (Diffusion Commit).Mar 4 2015, 8:20 AM
epriestley added a commit: Unknown Object (Diffusion Commit).
Aklapper changed the task status from Resolved to Declined.Mar 4 2015, 11:40 AM
Aklapper claimed this task.