Jdouglas has uploaded a new change for review.

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

Change subject: Loosen restrictions for certain searches
......................................................................

Loosen restrictions for certain searches

When searching for intitle:Theophan intitle:R* and expecting to find
"Theophan the Recluse", we need to relax restrictions for results to
come back:

It is too restrictive to *both* rewrite a multi term query to include
only the top 128 terms *and* require all the terms (via boolean AND
operations), so we need to pick only one of the two.

This patch makes two changes:

1. The filters favor the latter, dropping the rewrite.
2. The text queries retain the rewrite, but allow a default OR

Change-Id: I6c5529a1e5ea08eac71c7365a4681a9fd8770ec6
---
M includes/Search/Filters.php
M includes/Searcher.php
2 files changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/84/198284/1

diff --git a/includes/Search/Filters.php b/includes/Search/Filters.php
index 45f5c96..dc8d7a1 100644
--- a/includes/Search/Filters.php
+++ b/includes/Search/Filters.php
@@ -146,7 +146,6 @@
                $query->setDefaultOperator( 'AND' );
                $query->setAllowLeadingWildcard( false );
                $query->setFuzzyPrefixLength( 2 );
-               $query->setRewrite( 'top_terms_128' );
                $wrappedQuery = $searcher->wrapInSaferIfPossible( $query, false 
);
 
                $updateReferences =
diff --git a/includes/Searcher.php b/includes/Searcher.php
index 2c0ba8a..6045caf 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -1150,7 +1150,6 @@
                $query->setFields( $fields );
                $query->setAutoGeneratePhraseQueries( true );
                $query->setPhraseSlop( $phraseSlop );
-               $query->setDefaultOperator( 'AND' );
                $query->setAllowLeadingWildcard( false );
                $query->setFuzzyPrefixLength( 2 );
                $query->setRewrite( 'top_terms_128' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c5529a1e5ea08eac71c7365a4681a9fd8770ec6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Jdouglas <jdoug...@wikimedia.org>

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

Reply via email to