Last modified: 2010-05-15 15:28:21 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 T2811, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 811 - search doesn't return results when there is more than one match
search doesn't return results when there is more than one match
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Search (Other open bugs)
1.3.x
PC Linux
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.io.tudelft.nl/id/mediawiki
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-31 17:40 UTC by Maurits van der Schee
Modified: 2010-05-15 15:28 UTC (History)
0 users

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


Attachments

Description Maurits van der Schee 2004-10-31 17:40:31 UTC
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.
Comment 1 Brion Vibber 2004-10-31 23:55:12 UTC
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.
Comment 2 Brion Vibber 2004-11-01 09:41:30 UTC
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).

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


Navigation
Links