remove the vectorIndex autoload for buffer based searcher to reduce memory usage
This commit is contained in:
parent
05e9a55e02
commit
8ed03b40e6
|
|
@ -61,15 +61,7 @@ class XdbSearcher
|
||||||
function __construct($dbFile, $vectorIndex=null, $cBuff=null) {
|
function __construct($dbFile, $vectorIndex=null, $cBuff=null) {
|
||||||
// check the content buffer first
|
// check the content buffer first
|
||||||
if ($cBuff != null) {
|
if ($cBuff != null) {
|
||||||
// check and autoload the vector index
|
$this->vectorIndex = null;
|
||||||
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->contentBuff = $cBuff;
|
$this->contentBuff = $cBuff;
|
||||||
} else {
|
} else {
|
||||||
// open the xdb binary file
|
// open the xdb binary file
|
||||||
|
|
@ -357,4 +349,4 @@ class XdbSearcher
|
||||||
return (microtime(true) * 1000);
|
return (microtime(true) * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue