Chad has uploaded a new change for review.

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

Change subject: Remove content index segregation
......................................................................

Remove content index segregation

This isn't useful for most wikis and actually cases a huge performance
overhead as you start having tons of extra indexes and aliases that end
up being barely used.

Instead, put all namespaces that aren't explicitly mapped into the general
index.

This is a breaking change, please see the README for configuration to
replicate the existing configuration.

Change-Id: Id2e909b13f97defe8ca2a1b31414040567ea9900
---
M CirrusSearch.php
M README
M includes/Connection.php
3 files changed, 11 insertions(+), 15 deletions(-)


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

diff --git a/CirrusSearch.php b/CirrusSearch.php
index e39d162..51395d3 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -43,13 +43,13 @@
 $wgCirrusSearchConnectionAttempts = 1;
 
 // Number of shards for each index
-$wgCirrusSearchShardCount = array( 'content' => 4, 'general' => 4 );
+$wgCirrusSearchShardCount = array( 'general' => 4 );
 
 // Number of replicas per shard for each index
 // The default of 0 is fine for single-node setups, but if this is
 // deployed to a multi-node setting you probably at least want these
 // set to 1 for some redundancy, if not 2 for more redundancy.
-$wgCirrusSearchReplicaCount = array( 'content' => 0, 'general' => 0 );
+$wgCirrusSearchReplicaCount = array( 'general' => 0 );
 
 // How many seconds must a search of Elasticsearch be before we consider it
 // slow?  Default value is 10 seconds which should be fine for catching the 
rare
diff --git a/README b/README
index 67f818c..2ec9efc 100644
--- a/README
+++ b/README
@@ -175,7 +175,12 @@
 during upgrades.  More replicas will help distribute queries across more 
nodes.  Having more
 replicas than nodes doesn't make sense and Elasticsearch will stay "yellow" if 
you do that.
 Anyway, you should add this to LocalSettings.php to change it:
- $wgCirrusSearchReplicaCount = array( 'content' => 2, 'general' => 2 );
+ $wgCirrusSearchReplicaCount = array( 'general' => 2 );
+
+If your wiki is very large (millions of pages or more), you may consider 
splitting your index into
+multiple indicies. This used to be done automatically but was changed. The 
previous behavior can
+be emulated using $wgCirrusSearchNamespaceMappings by setting the content 
namespaces to an index
+called 'content.'
 
 
 Testing
diff --git a/includes/Connection.php b/includes/Connection.php
index 15f1caa..bff50f7 100644
--- a/includes/Connection.php
+++ b/includes/Connection.php
@@ -25,13 +25,7 @@
  */
 class Connection extends ElasticaConnection {
        /**
-        * Name of the index that holds content articles.
-        * @var string
-        */
-       const CONTENT_INDEX_TYPE = 'content';
-       
-       /**
-        * Name of the index that holds non-content articles.
+        * Name of the index that holds all articles not mapped to their own 
index.
         * @var string
         */
        const GENERAL_INDEX_TYPE = 'general';
@@ -78,7 +72,7 @@
        public static function getAllIndexTypes() {
                global $wgCirrusSearchNamespaceMappings;
                return array_merge( array_values( 
$wgCirrusSearchNamespaceMappings ),
-                       array( self::CONTENT_INDEX_TYPE, 
self::GENERAL_INDEX_TYPE ) );
+                       array( self::GENERAL_INDEX_TYPE ) );
        }
 
        /**
@@ -90,10 +84,7 @@
                global $wgCirrusSearchNamespaceMappings;
                if ( isset( $wgCirrusSearchNamespaceMappings[$namespace] ) ) {
                        return $wgCirrusSearchNamespaceMappings[$namespace];
-               } elseif ( MWNamespace::isContent( $namespace ) ) {
-                       return self::CONTENT_INDEX_TYPE;
-               } else {
-                       return self::GENERAL_INDEX_TYPE;
                }
+               return self::GENERAL_INDEX_TYPE;
        }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2e909b13f97defe8ca2a1b31414040567ea9900
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Chad <ch...@wikimedia.org>

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

Reply via email to