简体   繁体   English

使用RediSearch请求特定字段(不是所有字段)

[英]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.

相关问题 针对特定数据字段的高效搜索算法 - Efficient Search Algorithm For Specific Data Fields 无效对象所有字段的有效方式 - Performant way of nullifying all fields of an object 优化-在Mongoose MongoDB模式中的所有字段上查找 - Optimization - find on all fields in Mongoose MongoDB schema PostgreSQL:在所有表字段的长度上创建索引 - PostgreSQL: Create index on length of all table fields 索引此mysql查询中的所有字段是否可以? - Is it OK to index all the fields in this mysql query? LINQ to SQL:如何有条件地选择特定字段到DTO(性能) - LINQ to SQL: how to select specific fields conditionally into DTOs (performance) Spring数据-MongoDB:如何返回仅特定字段的页面/切片 - Spring data - MongoDB : How to return a page/slice of only specific fields 如何在忽略某些特定字段的同时获取数据? - How to fetch data while ignoring some specific fields? Vue 3:如何实现修改 DOM 中所有输入字段的 function? - Vue 3: How to implement a function that modifies all input fields in the DOM? 搜索可能位于3个字段中的任何一个或全部时创建的最佳索引 - Best indexes to create when a search may be on any or all of 3 fields
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM