Yaron Koren has uploaded a new change for review.

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

Change subject: Attempted improvements to Drilldown search highlighting
......................................................................

Attempted improvements to Drilldown search highlighting

Change-Id: I8fcd2bc0b9636b9ff032e8f0a8d292a26d5315fe
---
M CargoQueryDisplayer.php
1 file changed, 7 insertions(+), 1 deletion(-)


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

diff --git a/CargoQueryDisplayer.php b/CargoQueryDisplayer.php
index 4572a10..40f55cb 100644
--- a/CargoQueryDisplayer.php
+++ b/CargoQueryDisplayer.php
@@ -260,7 +260,13 @@
                list( $contextlines, $contextchars ) = 
SearchEngine::userHighlightPrefs();
 
                foreach ( $terms as $i => $term ) {
-                       $terms[$i] = str_replace( array( '"', "'" ), '', $term 
);
+                       // Try to map from a MySQL search to a PHP one -
+                       // this code could probably be improved.
+                       $term = str_replace( array( '"' /*, "'"*/, '+', '*' ), 
'', $term );
+                       if ( strpos( $term, '*' ) !== false ) {
+                               $term = '\b' . $term . '\b';
+                       }
+                       $terms[$i] = $term;
                }
 
                $h = new SearchHighlighter();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fcd2bc0b9636b9ff032e8f0a8d292a26d5315fe
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