Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/352277 )

Change subject: Make config update produce configs that do not always require 
updating.
......................................................................

Make config update produce configs that do not always require updating.

Two changes:
1. buildConfig() reused the same var and produced broken config
2. Short text field does not need positions, as it is the default.

Bug: T164619
Change-Id: Ic6620f04557186584e989b81f66a07a33e319810
---
M includes/Maintenance/MappingConfigBuilder.php
M includes/Search/ShortTextIndexField.php
2 files changed, 6 insertions(+), 9 deletions(-)


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

diff --git a/includes/Maintenance/MappingConfigBuilder.php 
b/includes/Maintenance/MappingConfigBuilder.php
index 548448d..05bb836 100644
--- a/includes/Maintenance/MappingConfigBuilder.php
+++ b/includes/Maintenance/MappingConfigBuilder.php
@@ -252,9 +252,9 @@
                        $page = $this->setupCopyTo( $page, $nearMatchFields, 
'all_near_match' );
                }
 
-               $config[ 'page' ] = $page;
+               $mappingConfig = [ 'page' => $page ];
 
-               $config[ 'namespace' ] = [
+               $mappingConfig[ 'namespace' ] = [
                        'dynamic' => false,
                        '_all' => [ 'enabled' => false ],
                        'properties' => [
@@ -269,7 +269,7 @@
                        ],
                ];
 
-               $config[ 'archive' ] = [
+               $mappingConfig[ 'archive' ] = [
                        'dynamic' => false,
                        '_all' => [ 'enabled' => false ],
                        'properties' => [
@@ -279,11 +279,11 @@
                        ],
                ];
                // Do not use copy settings for archive
-               unset( $config['archive']['properties']['title']['copy_to'] );
+               unset( 
$mappingConfig['archive']['properties']['title']['copy_to'] );
 
-               Hooks::run( 'CirrusSearchMappingConfig', [ &$config, $this ] );
+               Hooks::run( 'CirrusSearchMappingConfig', [ &$mappingConfig, 
$this ] );
 
-               return $config;
+               return $mappingConfig;
        }
 
        /**
diff --git a/includes/Search/ShortTextIndexField.php 
b/includes/Search/ShortTextIndexField.php
index 68238bf..19999f6 100644
--- a/includes/Search/ShortTextIndexField.php
+++ b/includes/Search/ShortTextIndexField.php
@@ -23,9 +23,6 @@
                $config += [
                        // Omit the length norm because we use it only for 
filtering
                        'norms' => false,
-                       // Store positions because by using aggressive_splitting
-                       // we need to allow precise position matching with 
phrases
-                       'index_options' => 'positions',
                ];
                return $config;
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6620f04557186584e989b81f66a07a33e319810
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <[email protected]>

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

Reply via email to