From 11df874b5ddc70ef8f74f56580765ceab6740da2 Mon Sep 17 00:00:00 2001 From: lion Date: Thu, 23 Jun 2022 15:03:18 +0800 Subject: [PATCH] reduce the data copy for vectorIndex search with content cached --- binding/php/XdbSearcher.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/binding/php/XdbSearcher.class.php b/binding/php/XdbSearcher.class.php index d5292d7..6ebd375 100644 --- a/binding/php/XdbSearcher.class.php +++ b/binding/php/XdbSearcher.class.php @@ -108,6 +108,9 @@ class XdbSearcher if ($this->vectorIndex != null) { $sPtr = self::getLong($this->vectorIndex, $idx); $ePtr = self::getLong($this->vectorIndex, $idx + 4); + } else if ($this->contentBuff != null) { + $sPtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx); + $ePtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx + 4); } else { // read the vector index block $buff = $this->read(self::HeaderInfoLength + $idx, 8);