From ca6b26c53a95566b90e5523ae1b1776bee25f9b6 Mon Sep 17 00:00:00 2001 From: lion Date: Thu, 23 Jun 2022 11:42:28 +0800 Subject: [PATCH] remove the vectorIndex autoload for buffer based searcher to reduce memory usage --- binding/php/XdbSearcher.class.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/binding/php/XdbSearcher.class.php b/binding/php/XdbSearcher.class.php index 5a938ba..ade4a87 100644 --- a/binding/php/XdbSearcher.class.php +++ b/binding/php/XdbSearcher.class.php @@ -61,15 +61,7 @@ class XdbSearcher function __construct($dbFile, $vectorIndex=null, $cBuff=null) { // check the content buffer first if ($cBuff != null) { - // check and autoload the vector index - if ($vectorIndex != null) { - // load the vector index - $this->vectorIndex = self::loadVectorIndexFromBuff($cBuff); - if ($this->vectorIndex == null) { - throw new Exception("failed to load vector index from buffer"); - } - } - + $this->vectorIndex = null; $this->contentBuff = $cBuff; } else { // open the xdb binary file @@ -357,4 +349,4 @@ class XdbSearcher return (microtime(true) * 1000); } -} \ No newline at end of file +}