Closed MacFJA closed 2 years ago
The RediSearch version detection is implemented (since c904606f4800c803216587b3d4349c84a907e754) in: https://github.com/MacFJA/php-redisearch/blob/c904606f4800c803216587b3d4349c84a907e754/src/Redis/Initializer.php#L93
(Usage: $version = \MacFJA\RediSearch\Redis\Initializer::getRediSearchVersion($redisClient)
)
All Redis commands for RediSearch have a parameter in their constructor to specify the version of RediSearch
High level classes (\MacFJA\RediSearch\Index
and \MacFJA\RediSearch\Suggestions
) use the version detection internally.
Issue is kept open until the release of the version 2.0.0
Add a feature to detect RediSearch version to handle RediSearch capability depending on the version.
Some RediSearch features are not available in all versions of RediSearch 2.x To prevent sending incompatible request to RediSearch server, it would be create to catch those incompatibilities at the lib level.
To get the RediSearch version the command
INFO Modules
with a bit of filtering should give all the needed information, or a generic configuration added to all objectsThis protective behavior should be deactivable, as it can cost (especially the RediSearch version requesting in Redis)