remove the vectorIndex autoload for buffer based searcher to reduce memory usage

This commit is contained in:
lion 2022-06-23 11:42:28 +08:00
parent a835d15d0a
commit ca6b26c53a
1 changed files with 2 additions and 10 deletions

View File

@ -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