[英]Request specific fields (not all fields) with RediSearch
Here's an official example of a RediSearch query : 这是RediSearch查询的官方示例 :
127.0.0.1:6379> FT.SEARCH myIdx "hello world" LIMIT 0 10
1) (integer) 1
2) "doc1"
3) 1) "title"
2) "hello world"
3) "body"
4) "lorem ipsum"
5) "url"
6) "http://redis.io"
My question is, how could I request just one or two fields, eg just to get back to the "title" value ("hello world") or the "ID" and "title" fields ([1, "hello world"]). 我的问题是,我如何只请求一个或两个字段,例如,仅返回“ title”值(“ hello world”)还是“ ID”和“ title”字段([1,“ hello world”]) )。 Mainly for performance reasons.
主要是出于性能原因。
Yes, it supports it with the RETURN
option. 是的,它支持
RETURN
选项。
127.0.0.1:6379> FT.SEARCH myIdx "hello world" LIMIT 0 10 RETURN 2 title url
See: https://oss.redislabs.com/redisearch/Commands/#ftsearch 请参阅: https : //oss.redislabs.com/redisearch/Commands/#ftsearch
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.