Redisearch中的术语频率

时间:2019-05-07 20:21:35

标签: frequency redisearch

Redisearch中是否有一种方法可以获取搜索词的频率?例如,如果我在Redisearch中有以下文档

127.0.0.1:6379> FT.CREATE myIndex SCHEMA fileName TEXT SORTABLE content TEXT SORTABLE docId TAG SORTABLE NOINDEX
OK
127.0.0.1:6379> FT.ADD myIndex doc1 1.0 FIELDS fileName file1 content "lorem ipsum" docId doc1
OK
127.0.0.1:6379> FT.ADD myIndex doc2 1.0 FIELDS fileName file2 content "lorem ipsum lorem ipsum" docId doc2
OK
127.0.0.1:6379> FT.ADD myIndex doc3 1.0 FIELDS fileName file3 content "lorem ipsum lorem ipsum lorem ipsum" docId doc3
OK

是否可以获取每个文档中“ lorem”一词的计数?

我尝试使用此聚合命令,但无法获得搜索词的频率。

127.0.0.1:6379> FT.AGGREGATE myIndex "lorem" GROUPBY 1 @content REDUCE COUNT 0 as frequency
1) (integer) 3
2) 1) "content"
   2) "lorem ipsum lorem ipsum"
   3) "frequency"
   4) "1"
3) 1) "content"
   2) "lorem ipsum"
   3) "frequency"
   4) "1"
4) 1) "content"
   2) "lorem ipsum lorem ipsum lorem ipsum"
   3) "frequency"
   4) "1"

0 个答案:

没有答案