Fixing an issue in group iterator where not the highest element of group displayed

Chris Pollett [2023-09-01 18:Sep:st]
Fixing an issue in group iterator where not the highest element of group displayed
Filename
src/library/index_bundle_iterators/GroupIterator.php
diff --git a/src/library/index_bundle_iterators/GroupIterator.php b/src/library/index_bundle_iterators/GroupIterator.php
index 8fcd326fa..5b8fd5f83 100644
--- a/src/library/index_bundle_iterators/GroupIterator.php
+++ b/src/library/index_bundle_iterators/GroupIterator.php
@@ -308,19 +308,10 @@ class GroupIterator extends IndexBundleIterator
                 if ($first_time) {
                     $first_hash_url = $hash_url;
                     $first_time = false;
-                } else {
-                    $pre_out_pages[$first_hash_url][0][self::SCORE] = max(
-                        $pre_out_pages[$first_hash_url][0][self::SCORE],
-                        $pre_out_pages[$hash_url][0][self::SCORE]);
-                    $pre_out_pages[$first_hash_url][0][self::DOC_RANK] = max(
-                        $pre_out_pages[$first_hash_url][0][self::DOC_RANK],
-                        $pre_out_pages[$hash_url][0][self::DOC_RANK]);
-                    $pre_out_pages[$first_hash_url][0][self::RELEVANCE] = max(
-                        $pre_out_pages[$first_hash_url][0][self::RELEVANCE],
-                        $pre_out_pages[$hash_url][0][self::RELEVANCE]);
-                    $pre_out_pages[$first_hash_url][0][self::PROXIMITY] = max(
-                        $pre_out_pages[$first_hash_url][0][self::PROXIMITY],
-                        $pre_out_pages[$hash_url][0][self::PROXIMITY]);
+                } else if ($pre_out_pages[$first_hash_url][0][self::SCORE] <
+                    $pre_out_pages[$hash_url][0][self::SCORE]) {
+                    $pre_out_pages[$first_hash_url] =
+                        $pre_out_pages[$hash_url];
                     unset($pre_out_pages[$hash_url]);
                 }
             }
ViewGit