Reputation: 600
I have two solr collections
I need to join these two collections and get one final result with both collections data.
Collection-A:
[
{
"uuId": "000000",
"oName": "IN",
"paId": "IN01",
"pName": "ABCD"
},
{
"uuId": "111111",
"oName": "IN",
"paId": "IN02",
"pName": "DEF"
}
]
Collection-B:
[
{
"uuId": "333333",
"firstName": "John",
"lastName": "Doe",
"pId": "IN01",
"pName": "ABCD"
},
{
"uuId": "444444",
"firstName": "Saman",
"lastName": "Lee",
"pId": "IN02",
"pName": "DEF"
}
]
Expected results:
[
{
"uuId": "000000",
"oName": "IN",
"paId": "IN01",
"pName": "ABCD",
"firstName": "John",
"lastName": "Doe"
},
{
"uuId": "111111",
"oName": "IN",
"paId": "IN02",
"pName": "DEF",
"firstName": "Saman",
"lastName": "Lee"
}
]
Solr UI:
On Collection-A: I have added fq -> {!join from=pId fromIndex=Collection-B to=paId}
I am able to get the results for this, But not getting the Collection-B's firstName,lastName. (Expected results)
Upvotes: 1
Views: 341
Reputation: 8658
You can use the joins only to filter the data from solr. You cannot use the solr join to fetch the data from another collection.
Please refer the below link for the same. Solr Join across collection
Upvotes: 1