0

Is it possible to retrieve the common values that were used in a Solr join?

For example, say I have two cores:

1) hospital, fields: id, doctor_id (multiValued), patient_id (multiValued)
2) dental_office, fields: id, dentist_id (multiValued) patient_id (multiValued)

I would like to find all of the patients who go to go to a specific dental_office (id = 2) and see a specific doctor (doctor_id = 123).

Currently my query on the hospital core looks like this:

"q=doctor_id:(123)",
"fq={!join from=patient_id to=patient_id fromIndex=dental_office}id:(2)"

However this returns the hospitals that match the query, but in reality I want to select the hospitals along with which matched patient_ids. Something such as:

hospital docs:
{ id: 1, patient_ids: [234, 56, 8] }
{ id: 8, patient_ids: [8, 45, 89] }

This seems difficult since patient_ids is multiValued. Is there a way to do this?

Thanks!

Abhijit Bashetti
  • 8,518
  • 7
  • 35
  • 47
Sam
  • 1
  • 1

1 Answers1

0

solr is document oriented, so you can't do JOINs between cores

Azat Nugusbayev
  • 1,391
  • 11
  • 19
  • Hi Azat, I'm confused by your response -- you can see my current query in my question is joining the hospital and dental_office cores and works fine. – Sam Dec 22 '15 at 20:48