|
21 | 21 |
|
22 | 22 | namespace MacFJA\RediSearch\Redis;
|
23 | 23 |
|
24 |
| -use function count; |
25 |
| -use MacFJA\RediSearch\Redis\Client\AbstractClient; |
| 24 | +use MacFJA\RediSearch\Redis\Client\Rediska\RediskaRediSearchCommand; |
26 | 25 | use MacFJA\RediSearch\Redis\Command\Aggregate;
|
27 | 26 | use MacFJA\RediSearch\Redis\Command\AliasAdd;
|
28 | 27 | use MacFJA\RediSearch\Redis\Command\AliasDel;
|
|
51 | 50 | use MacFJA\RediSearch\Redis\Command\SynUpdate;
|
52 | 51 | use MacFJA\RediSearch\Redis\Command\TagVals;
|
53 | 52 | use Predis\Profile\RedisProfile;
|
54 |
| -use Rediska_Command_Abstract; |
55 | 53 | use Rediska_Commands;
|
56 |
| -use Rediska_Connection_Exec; |
57 |
| - |
58 |
| -if (class_exists(Rediska_Command_Abstract::class) && class_exists(Rediska_Connection_Exec::class)) { |
59 |
| - /** |
60 |
| - * @codeCoverageIgnore |
61 |
| - */ |
62 |
| - class RediskaRediSearch extends Rediska_Command_Abstract |
63 |
| - { |
64 |
| - public function create(): Rediska_Connection_Exec |
65 |
| - { |
66 |
| - $connections = $this->_rediska->getConnections(); |
67 |
| - |
68 |
| - if (false === AbstractClient::$disableNotice && count($connections) > 1) { |
69 |
| - trigger_error('Warning, Multiple redis connections exists, only the first connection will be used', E_USER_NOTICE); |
70 |
| - } |
71 |
| - $connection = reset($connections); |
72 |
| - |
73 |
| - $commands = $this->_arguments; |
74 |
| - if (!('__redisearch' === $this->_name)) { |
75 |
| - array_unshift($commands, $this->_name); |
76 |
| - } |
77 |
| - |
78 |
| - return new Rediska_Connection_Exec($connection, $commands); |
79 |
| - } |
80 |
| - } |
81 |
| -} |
82 | 54 |
|
83 | 55 | /**
|
84 | 56 | * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
@@ -124,34 +96,34 @@ public static function registerCommandsPredis(RedisProfile $profile): void
|
124 | 96 | */
|
125 | 97 | public static function registerCommandsRediska(): void
|
126 | 98 | {
|
127 |
| - Rediska_Commands::add('ftaggregate', RediskaRediSearch::class); |
128 |
| - Rediska_Commands::add('ftaliasadd', RediskaRediSearch::class); |
129 |
| - Rediska_Commands::add('ftaliasdel', RediskaRediSearch::class); |
130 |
| - Rediska_Commands::add('ftaliasupdate', RediskaRediSearch::class); |
131 |
| - Rediska_Commands::add('ftalter', RediskaRediSearch::class); |
132 |
| - Rediska_Commands::add('ftconfig', RediskaRediSearch::class); |
133 |
| - Rediska_Commands::add('ftconfigset', RediskaRediSearch::class); |
134 |
| - Rediska_Commands::add('ftcreate', RediskaRediSearch::class); |
135 |
| - Rediska_Commands::add('ftcursordel', RediskaRediSearch::class); |
136 |
| - Rediska_Commands::add('ftcursorread', RediskaRediSearch::class); |
137 |
| - Rediska_Commands::add('ftdictadd', RediskaRediSearch::class); |
138 |
| - Rediska_Commands::add('ftdictdel', RediskaRediSearch::class); |
139 |
| - Rediska_Commands::add('ftdictdump', RediskaRediSearch::class); |
140 |
| - Rediska_Commands::add('ftdropindex', RediskaRediSearch::class); |
141 |
| - Rediska_Commands::add('ftexplain', RediskaRediSearch::class); |
142 |
| - Rediska_Commands::add('ftexplaincli', RediskaRediSearch::class); |
143 |
| - Rediska_Commands::add('ftlist', RediskaRediSearch::class); |
144 |
| - Rediska_Commands::add('ftinfo', RediskaRediSearch::class); |
145 |
| - Rediska_Commands::add('ftsearch', RediskaRediSearch::class); |
146 |
| - Rediska_Commands::add('ftspellcheck', RediskaRediSearch::class); |
147 |
| - Rediska_Commands::add('ftsugadd', RediskaRediSearch::class); |
148 |
| - Rediska_Commands::add('ftsugdel', RediskaRediSearch::class); |
149 |
| - Rediska_Commands::add('ftsugget', RediskaRediSearch::class); |
150 |
| - Rediska_Commands::add('ftsuglen', RediskaRediSearch::class); |
151 |
| - Rediska_Commands::add('ftsyndump', RediskaRediSearch::class); |
152 |
| - Rediska_Commands::add('ftsynupdate', RediskaRediSearch::class); |
153 |
| - Rediska_Commands::add('fttagvals', RediskaRediSearch::class); |
154 |
| - Rediska_Commands::add('__redisearch', RediskaRediSearch::class); |
| 99 | + Rediska_Commands::add('ftaggregate', RediskaRediSearchCommand::class); |
| 100 | + Rediska_Commands::add('ftaliasadd', RediskaRediSearchCommand::class); |
| 101 | + Rediska_Commands::add('ftaliasdel', RediskaRediSearchCommand::class); |
| 102 | + Rediska_Commands::add('ftaliasupdate', RediskaRediSearchCommand::class); |
| 103 | + Rediska_Commands::add('ftalter', RediskaRediSearchCommand::class); |
| 104 | + Rediska_Commands::add('ftconfig', RediskaRediSearchCommand::class); |
| 105 | + Rediska_Commands::add('ftconfigset', RediskaRediSearchCommand::class); |
| 106 | + Rediska_Commands::add('ftcreate', RediskaRediSearchCommand::class); |
| 107 | + Rediska_Commands::add('ftcursordel', RediskaRediSearchCommand::class); |
| 108 | + Rediska_Commands::add('ftcursorread', RediskaRediSearchCommand::class); |
| 109 | + Rediska_Commands::add('ftdictadd', RediskaRediSearchCommand::class); |
| 110 | + Rediska_Commands::add('ftdictdel', RediskaRediSearchCommand::class); |
| 111 | + Rediska_Commands::add('ftdictdump', RediskaRediSearchCommand::class); |
| 112 | + Rediska_Commands::add('ftdropindex', RediskaRediSearchCommand::class); |
| 113 | + Rediska_Commands::add('ftexplain', RediskaRediSearchCommand::class); |
| 114 | + Rediska_Commands::add('ftexplaincli', RediskaRediSearchCommand::class); |
| 115 | + Rediska_Commands::add('ftlist', RediskaRediSearchCommand::class); |
| 116 | + Rediska_Commands::add('ftinfo', RediskaRediSearchCommand::class); |
| 117 | + Rediska_Commands::add('ftsearch', RediskaRediSearchCommand::class); |
| 118 | + Rediska_Commands::add('ftspellcheck', RediskaRediSearchCommand::class); |
| 119 | + Rediska_Commands::add('ftsugadd', RediskaRediSearchCommand::class); |
| 120 | + Rediska_Commands::add('ftsugdel', RediskaRediSearchCommand::class); |
| 121 | + Rediska_Commands::add('ftsugget', RediskaRediSearchCommand::class); |
| 122 | + Rediska_Commands::add('ftsuglen', RediskaRediSearchCommand::class); |
| 123 | + Rediska_Commands::add('ftsyndump', RediskaRediSearchCommand::class); |
| 124 | + Rediska_Commands::add('ftsynupdate', RediskaRediSearchCommand::class); |
| 125 | + Rediska_Commands::add('fttagvals', RediskaRediSearchCommand::class); |
| 126 | + Rediska_Commands::add('__redisearch', RediskaRediSearchCommand::class); |
155 | 127 | }
|
156 | 128 |
|
157 | 129 | public static function getRediSearchVersion(Client $client): ?string
|
|
0 commit comments