-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addDocumentFromArray is error,please help me #46
Comments
create index is ok |
Can you dump the content of /**
* @return null|array<string,mixed>|mixed
*/
public function getIndexDefinition(?string $key = null)
{
$rawDefinitions = self::getValue($this->rawLines, 'index_definition');
dd($rawDefinitions); // Add this line
assert(is_array($rawDefinitions));
$data = self::getPairs($rawDefinitions);
if (!is_string($key)) {
return $data;
}
return $data[$key] ?? null;
} |
$rawDefinitions = self::getValue($this->rawLines, 'index_definition'); |
today,It's ok useing old version1.4, |
I see in the result of your So it's impossible to find the right data (even result lines are the data key, and odd result lines are the data value) I can't reproduce yet your case. But as a work around for now you can just call redis // instead of
/*
$res=$index->addDocumentFromArray([
'zid'=>'553',
'bank_number'=>'666',
'today'=>'2022-07-21',
'shou'=>0,
'zhi'=>0,
'bank_balance'=>0
],$this->name.':'.'553');
*/
// Do this
$this->searchConnect->executeRaw(
'HSET',
$this->name . ':' . '553',
'zid', '553',
'bank_number', '666',
'today', '2022-07-21',
'shou', 0,
'zhi', 0,
'bank_balance', 0
); It's pretty much what do the |
vendor/macfja/redisearch/src/Redis/Client/PhpredisClient.php public function execute(Command $command)
{
$arguments = $command->getArguments();
if (0 === count($arguments)) {
/** @psalm-suppress TooFewArguments */
$rawResponse = $this->redis->rawCommand($command->getId());
} else {
// add line start
if ($command->getId()=='FT.INFO'){
$this->redis->setOption(\Redis::OPT_REPLY_LITERAL, true); //add this line solve the problems
}
// add line end,ft.info can get the correct value
$rawResponse = $this->redis->rawCommand($command->getId(), ...$arguments);
}
return $command->parseResponse($rawResponse);
} |
ths |
is error:
assert(is_array($rawDefinitions));
The text was updated successfully, but these errors were encountered: