Page MenuHomePhabricator

MSSQL: Fulltext search doesn’t work
Open, Needs TriagePublic


MSSQL: Fulltext search doesn’t work
I have MediaWiki 1.27.1 installed:
MediaWiki 1.27.1
PHP 5.6.20 (cgi-fcgi)
MS SQL Server 11.00.2100
Windows 7 Enterprise, Servicepack 1, 64 Bit

If I search for single words or phrases of the content of a wiki page there are no hits.

I had a look into the table searchindex. The fields si_title and si_text containing Chinese letters like 믯梿畡瑰敳瑩e. The content of the page in the table text (field old_text) is in English with Latin letters. If I type the search string “My Search String” in the search text control of the web page, MediaWiki uses this string for the query:

SELECT TOP 20 page_id, page_namespace, page_title, ftindex.[RANK]
FROM [COMIN_WIKI].[CI_page],FREETEXTTABLE([COMIN_WIKI].[CI_searchindex] , si_title, 'My Search String', LANGUAGE 'English') as ftindex
WHERE page_id=ftindex.[KEY]  AND page_namespace IN (0)

This statement has no results I guess because the searchindex table contains the query string in a different format as Chinese letters.

The function update( $id, $title, $text ) in includes\search\SearchMssql.php converts the values of $title and $text into hexadecimal values with the byte order mark prefix probably having a UTF-8 string. May be that that is not necessary or it should be done the same conversion for the query.

Event Timeline

Restricted Application added projects: Discovery, Discovery-Search. · View Herald TranscriptMay 23 2017, 1:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
debt moved this task from needs triage to later on... on the Discovery-Search board.
debt added a subscriber: debt.

We don't really support MSSQL, but we do help out with MySQL. Adding patch-welcome for help on this.

Heads-up: As per RFC discussion in August 2019, the previously experimental support for using Oracle or MSSQL as database backends in MediaWiki core has been removed in MediaWiki 1.34, so this task might end up as declined in the future.