Pwirth has submitted this change and it was merged.

Change subject: ExtendedSearch: do not automatically use fuzzy search when 
query is already fuzzy
......................................................................


ExtendedSearch: do not automatically use fuzzy search when query is already 
fuzzy

When query is already fuzzy or contains a near search, do not
automatically escalate to fuzzy if there are no results.

Change-Id: I081b69d1caaf80bb96512af1098d98fa19262d94
---
M ExtendedSearch/includes/SearchIndex/SearchIndex.class.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Pwirth: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ExtendedSearch/includes/SearchIndex/SearchIndex.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchIndex.class.php
index 5536103..1d59955 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchIndex.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchIndex.class.php
@@ -134,7 +134,11 @@
 
                $iNumFound = $oHits->response->numFound;
 
-               $bFuzzy = ( $iNumFound == 0 );
+               $bFuzzy = (
+                       $iNumFound == 0 &&
+                       // do not escalate to fuzzy if the query already 
contails fuzzy or near operator
+                       !strpos( $this->oSearchOptions->getOption( 
'searchStringRaw' ), '~' )
+               );
                // Make a fuzzy query
                if ( $bFuzzy ) {
                        $aFuzzyQuery = 
$this->oSearchOptions->getSolrFuzzyQuery();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I081b69d1caaf80bb96512af1098d98fa19262d94
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Mglaser <[email protected]>
Gerrit-Reviewer: Dvogel hallowelt <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to