Yaron Koren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316505

Change subject: Added CargoUtils::fullTextMatchSQL()
......................................................................

Added CargoUtils::fullTextMatchSQL()

Change-Id: I87c2d7ccfa86f6bec186cca3a70b0a86243c8fc4
---
M CargoUtils.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/05/316505/2

diff --git a/CargoUtils.php b/CargoUtils.php
index 0c683aa..38b5a27 100644
--- a/CargoUtils.php
+++ b/CargoUtils.php
@@ -660,6 +660,12 @@
                ) );
        }
 
+       public static function fullTextMatchSQL( $cdb, $tableName, $fieldName, 
$searchTerm ) {
+               $fullFieldName = self::escapedFieldName( $cdb, $tableName, 
$fieldName );
+               $searchTerm = str_replace( "'", "\'", $searchTerm );
+               return " MATCH($fullFieldName) AGAINST ('$searchTerm' IN 
BOOLEAN MODE) ";
+       }
+
        /**
         * Parses one half of a set of coordinates into a number.
         *

-- 
To view, visit https://gerrit.wikimedia.org/r/316505
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87c2d7ccfa86f6bec186cca3a70b0a86243c8fc4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <yaro...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to