0

I have Solr documents having 3 fields Sender, Receiver and Time. 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):

Sender Reciever Time

  1. John Robert 10
  2. John Rocky 20
  3. Robert John 10
  4. Rocky John 20

Expected Output

  1. John Robert ->Total Time = 20*(10+10)*
  2. John Rocky ->Total Time = 40*(20+20)*

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.

sdkjain
  • 51
  • 1
  • 6

1 Answers1

0

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.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27