MacFJA / php-redisearch

PHP Client for RediSearch
MIT License
66 stars 9 forks source link

After pulling the new code, there was an error in creating the index #49

Closed itmeicn closed 2 years ago

itmeicn commented 2 years ago

code:

  $builder=new \MacFJA\RediSearch\IndexBuilder();
            $res=$builder->setIndex($this->name)->addPrefixes($this->name.'1:')

                ->addTextField('lastname',false,null,null,true,true)
                ->addTextField('firstname',false,null,null,true,true)
                ->addNumericField('age',true,true)
                ->create($this->clientPhprearch);

is error: \vendor\macfja\redisearch\src\Redis\Client\PhpredisClient.php line 55 Unknown Index name

   public function execute(Command $command)
    {
        $arguments = $command->getArguments();
        if (0 === count($arguments)) {
            /** @psalm-suppress TooFewArguments */
            $rawResponse = $this->redis->rawCommand($command->getId());
        } else {
           $rawResponse = $this->redis->rawCommand($command->getId(), ...$arguments);// errors 
        }

        return $command->parseResponse($rawResponse);
    }
itmeicn commented 2 years ago

The syntax I wrote is wrong, it's not the program's problem