viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Attempt to reduce query retrieval time by sending less data in raw=1 case take 7, a=chris

Chris Pollett [2019-07-11 19:Jul:th]
Attempt to reduce query retrieval time by sending less data in raw=1 case take 7, a=chris
Filename
src/models/PhraseModel.php
diff --git a/src/models/PhraseModel.php b/src/models/PhraseModel.php
index 53bb40b43..9a1746fed 100755
--- a/src/models/PhraseModel.php
+++ b/src/models/PhraseModel.php
@@ -1255,26 +1255,18 @@ class PhraseModel extends ParallelModel
         if ($raw == 1 && $save_timestamp_name == "") {
             $pages = array_slice($pages, $start_slice);
             $pages = array_slice($pages, $limit - $start_slice, $num);
-            $result_pages = [];
+            $i = 0;
             foreach ($pages as $p) {
-                $result_page = [
-                    self::HASH => $p[self::HASH],
-                    self::IS_DOC => $p[self::IS_DOC],
-                    self::INLINKS => $p[self::INLINKS],
-                    self::SCORE => $p[self::SCORE],
-                    self::USER_RANKS => $p[self::USER_RANKS],
-                    self::DOC_RANK => number_format($p[self::DOC_RANK], 4),
-                    self::RELEVANCE => number_format($p[self::RELEVANCE], 4),
-                    self::PROXIMITY => number_format($p[self::PROXIMITY],4),
-                    self::KEY => $p[self::KEY],
-                    self::CRAWL_TIME => $p[self::CRAWL_TIME],
-                    self::SUMMARY_OFFSET => $p[self::SUMMARY_OFFSET] ];
-                if (isset($p[self::MACHINE_ID])) {
-                    $result_page[self::MACHINE_ID] = $p[self::MACHINE_ID];
-                }
-                $result_pages[] = $result_page;
-            }
-            $results['PAGES'] = & $result_pages;
+                $pages[$i][self::SCORE] = number_format($p[self::SCORE],4);
+                $pages[$i][self::DOC_RANK] = number_format(
+                    $p[self::DOC_RANK], 4);
+                $pages[$i][self::RELEVANCE] = number_format(
+                    $p[self::RELEVANCE], 4);
+                $pages[$i][self::PROXIMITY] = number_format(
+                    $p[self::PROXIMITY],4);
+                unset($pages[$i][self::DESCRIPTION_SCORES]);
+            }
+            $results['PAGES'] = & $pages;
             if ($old_to_retrieve != $to_retrieve) {
                 $results['HARD_QUERY'] = $old_to_retrieve;
             }
ViewGit