下载PHP redisearch
composer require macfja/redisearch
这个客户端支持redis扩展 ,predis等
GitHub - MacFJA/php-redisearch: PHP Client for RediSearch
https://redis.io/commands/ft.create/
我这里命令执行创建索引
ft.CREATE userIdx ON HASH PREFIX 1 {user}:id: SCHEMA city TEXT id NUMERIC nickname TEXT mobile TEXT address GEO status TAG dispatch_status TAG SORTABLE NOINDEX push_token text
$clientFacade = new \MacFJA\RediSearch\Redis\Client\ClientFacade();
// With Predis
$client = $clientFacade->getClient(new \Predis\Client(/* ... */));
// With Phpredis extension
$client = $clientFacade->getClient(new \Redis([/* ... */]));
/