git clone https://github.com/RediSearch/RediSearch.git cd RediSearch make setup make all # 进入编译的目录 cd ./bin/linux-x64-release/search/ # 复制redisearch.so 到 redis工作目录下 apt安装的复制到/etc/redis下 mv ./redisearch.so /etc/redis/
# 创建索引并且定义格式 FT.CREATE myIdx ON HASH PREFIX 1 doc: SCHEMA title TEXT WEIGHT 5.0 body TEXT url TEXT # 添加索引记录 hset doc:1 title "hello world" body "lorem ipsum" url "http://redis.io" # 搜索索引 FT.SEARCH myIdx "hello" LIMIT 0 10