[英]Solr Query for a a Unique pair
I have Solr documents having 3 fields Sender, Receiver and Time. 我有具有3个字段发件人,收件人和时间的Solr文档。 I want to query what is the total time for all unique pair of Sender+Reciever. 我想查询发件人和收件人的所有唯一对的总时间是多少。
Below is Solr Document format and 4 record(for example): 下面是Solr文档格式和4条记录(例如):
Sender Reciever Time 发件人收件时间
Expected Output 预期产量
What is the query that I can write for it(single or nested). 我可以为其编写的查询是什么(单个或嵌套)。 I tried stats but I am not able to put condition for a unique pair. 我尝试了统计数据,但无法为唯一一对设置条件。
You could use the signature generated from those two fields and then group/stat on those. 您可以使用从这两个字段生成的签名 ,然后对它们进行分组/统计。 But you need to do that during indexing time. 但是您需要在索引期间执行此操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.