https://www.mediawiki.org/wiki/Special:Code/MediaWiki/115487

Revision: 115487
Author:   svemir
Date:     2012-06-07 13:36:57 +0000 (Thu, 07 Jun 2012)
Log Message:
-----------
always return result set when suggestions are on

When no result set is returned, hasSuggestion is not even called,
so now we retur a result set even when it is empty, if
suggestions are enabled.

Modified Paths:
--------------
    trunk/extensions/SphinxSearch/SphinxMWSearch.php

Modified: trunk/extensions/SphinxSearch/SphinxMWSearch.php
===================================================================
--- trunk/extensions/SphinxSearch/SphinxMWSearch.php    2012-06-07 12:13:59 UTC 
(rev 115486)
+++ trunk/extensions/SphinxSearch/SphinxMWSearch.php    2012-06-07 13:36:57 UTC 
(rev 115487)
@@ -63,7 +63,7 @@
         * @access public
         */
        function searchText( $term ) {
-               global $wgSphinxSearch_index_list;
+               global $wgSphinxSearch_index_list, $wgSphinxSuggestMode;
 
                if ( !$this->sphinx_client ) {
                        $this->sphinx_client = $this->prepareSphinxClient( 
$term );
@@ -110,7 +110,7 @@
                        $resultSet = false;
                }
 
-               if ( $resultSet === false ) {
+               if ( $resultSet === false && !$wgSphinxSuggestMode ) {
                        return null;
                } else {
                        return new SphinxMWSearchResultSet( $resultSet, $term, 
$this->sphinx_client, $this->db );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to