Skip to content

Commit

Permalink
Extended RediSearch support by implementing FT.SEARCH command (#1145)
Browse files Browse the repository at this point in the history
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* add support for CF.ADDNX

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* fix key name

* fix wrong command

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Pulling changes

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for search command arguments, implemented FT.SEARCH command

* Fixed vector field, removed default assignments, fixed tests

* Tests fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Merge conflicts

* Codestyle fixes

* Changed return annotation

* Separate common and create interfaces

* Codestyle fixes

* Changed search arguments to condiional

* Codestyle fixes

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
  • Loading branch information
5 people committed Feb 21, 2023
1 parent 3caa973 commit 7eb87c9
Show file tree
Hide file tree
Showing 9 changed files with 1,056 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/ClientContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Predis\Command\Argument\Geospatial\FromInterface;
use Predis\Command\Argument\Search\CreateArguments;
use Predis\Command\Argument\Search\Schema;
use Predis\Command\Argument\Search\SearchArguments;
use Predis\Command\Argument\Server\LimitOffsetCount;
use Predis\Command\Argument\Server\To;
use Predis\Command\CommandInterface;
Expand Down Expand Up @@ -86,7 +87,8 @@
* @method $this decrby($key, $decrement)
* @method $this failover(?To $to = null, bool $abort = false, int $timeout = -1)
* @method $this fcall(string $function, array $keys, ...$args)
* @method $this ftcreate(string $index, CreateArguments $arguments, Schema $schema)
* @method $this ftcreate(string $index, Schema $schema, ?CreateArguments $arguments = null)
* @method $this ftsearch(string $index, string $query, ?SearchArguments $arguments = null)
* @method $this get($key)
* @method $this getbit($key, $offset)
* @method $this getex(string $key, $modifier = '', $value = false)
Expand Down
2 changes: 2 additions & 0 deletions src/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Predis\Command\Argument\Geospatial\FromInterface;
use Predis\Command\Argument\Search\CreateArguments;
use Predis\Command\Argument\Search\Schema;
use Predis\Command\Argument\Search\SearchArguments;
use Predis\Command\Argument\Server\LimitOffsetCount;
use Predis\Command\Argument\Server\To;
use Predis\Command\CommandInterface;
Expand Down Expand Up @@ -96,6 +97,7 @@
* @method Status failover(?To $to = null, bool $abort = false, int $timeout = -1)
* @method mixed fcall(string $function, array $keys, ...$args)
* @method Status ftcreate(string $index, Schema $schema, ?CreateArguments $arguments = null)
* @method array ftsearch(string $index, string $query, ?SearchArguments $arguments = null)
* @method string|null get(string $key)
* @method int getbit(string $key, $offset)
* @method int|null getex(string $key, $modifier = '', $value = false)
Expand Down
16 changes: 16 additions & 0 deletions src/Command/Argument/Search/CommonArguments.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ public function language(string $defaultLanguage): self
return $this;
}

/**
* Selects the dialect version under which to execute the query.
* If not specified, the query will execute under the default dialect version
* set during module initial loading or via FT.CONFIG SET command.
*
* @param string $dialect
* @return $this
*/
public function dialect(string $dialect): self
{
$this->arguments[] = 'DIALECT';
$this->arguments[] = $dialect;

return $this;
}

/**
* {@inheritDoc}
*/
Expand Down
Loading

0 comments on commit 7eb87c9

Please sign in to comment.