Robert Vogel has submitted this change and it was merged.

Change subject: Extended Search: Changed default facet operator to AND
......................................................................


Extended Search: Changed default facet operator to AND

Default facet operator for categories and editors is now "AND". This
matches user expectations better.

Change-Id: I811f56f942e02e6664565ed0a775d73ac64f459a
(cherry picked from commit fd3d34ed7e5f64eb259dee92db99203565eb13ee)
---
M ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
M ExtendedSearch/includes/SearchIndex/SearchResult.class.php
2 files changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved



diff --git a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
index 28af2a5..15a16b7 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
@@ -579,8 +579,13 @@
                 * But without a major refactoring there is not nice way to do 
this.
                 */
                $sLogOp = ' OR ';
+               if ( in_array( $sTagName, array( 'ca', 'ed' ) ) ) {
+                       $sLogOp = ' AND ';
+               }
                if( isset( $this->aOptions['fset'][$sTagName]['op'] ) ) {
-                       if( strtoupper( 
$this->aOptions['fset'][$sTagName]['op'] ) === 'AND' ) {
+                       if( strtoupper( 
$this->aOptions['fset'][$sTagName]['op'] ) === 'OR' ) {
+                               $sLogOp = ' OR ';
+                       } else {
                                $sLogOp = ' AND ';
                        }
                }
diff --git a/ExtendedSearch/includes/SearchIndex/SearchResult.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchResult.class.php
index 9f05a6f..d5b09ee 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchResult.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchResult.class.php
@@ -149,6 +149,7 @@
                        : array( 'count' => 1 );
                $this->setData( 'sortorder' , $aOrder );
 
+               // see also SearchOptions::getFacetOperator
                $aBaseFacets = array(
                        'namespace' => array(
                                'param' => 'na',
@@ -168,7 +169,7 @@
                                        SearchUriBuilder::CATS
                                ),
                                'settings' => array(
-                                       'op' => 'OR'
+                                       'op' => 'AND'
                                )
                        ),
                        'editor' => array(
@@ -180,7 +181,7 @@
                                        
SearchUriBuilder::NAMESPACES|SearchUriBuilder::EDITOR
                                ),
                                'settings' => array(
-                                       'op' => 'OR'
+                                       'op' => 'AND'
                                )
                        ),
                        'type' => array(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I811f56f942e02e6664565ed0a775d73ac64f459a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_23
Gerrit-Owner: Mglaser <gla...@hallowelt.biz>
Gerrit-Reviewer: Dvogel hallowelt <daniel.vo...@hallowelt.com>
Gerrit-Reviewer: Ljonka <l.verhovs...@gmail.com>
Gerrit-Reviewer: Pwirth <wi...@hallowelt.biz>
Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz>
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