Manybubbles has uploaded a new change for review.

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

Change subject: Store weighted all_near_match with freqs
......................................................................

Store weighted all_near_match with freqs

We need the freqs to calculate weight properly.

Some comments too.

Change-Id: Ifa142233134c77d077920fb29f3df7f54540cf8e
---
M includes/Maintenance/MappingConfigBuilder.php
1 file changed, 4 insertions(+), 2 deletions(-)


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

diff --git a/includes/Maintenance/MappingConfigBuilder.php 
b/includes/Maintenance/MappingConfigBuilder.php
index db2e8ff..747dbbf 100644
--- a/includes/Maintenance/MappingConfigBuilder.php
+++ b/includes/Maintenance/MappingConfigBuilder.php
@@ -181,7 +181,7 @@
                        $config[ 'properties' ][ 'all_near_match' ] = array(
                                'type' => 'string',
                                'analyzer' => 'near_match',
-                               'index_options' => 'docs',
+                               'index_options' => 'freqs',
                                'position_offset_gap' => 
self::POSITION_OFFSET_GAP,
                                'norms' => array( 'enabled' => false ),
                        );
@@ -197,7 +197,7 @@
        }
 
        /**
-        * Setup copy_to for some fields to $destionation.
+        * Setup copy_to for some fields to $destination.
         * @param array $config to modify
         * @param array $fields field name to number of times copied
         * @param string $destination destination of the copy
@@ -205,6 +205,8 @@
         */
        private function setupCopyTo( $config, $fields, $destination ) {
                foreach ( $fields as $field => $weight ) {
+                       // Note that weights this causes weights that are not 
whole numbers to be rounded up.
+                       // We're ok with that because we don't have a choice.
                        for ( $r = 0; $r < $weight; $r++ ) {
                                if ( $field === 'redirect' ) {
                                        // Redirect is in a funky place

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa142233134c77d077920fb29f3df7f54540cf8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <never...@wikimedia.org>

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

Reply via email to