Reputation: 16362
For a quick project (not homework, I promise!), I have a simple solr installation with two cores, 'people' and 'jobs'. Each has some structured data, but also a text field.
I'd like to do a query using people.text to query into jobs.text.
I've not been able to find an example of this and the SolrQuerySyntax page doesn't reference collections or cores.
There is no field for using a real 'join'.
Is it possible? Can you point me to an example/tutorial?
Thanks.
Upvotes: 3
Views: 2262
Reputation: 665
Solr Joins can be performed across cores. Refer this StackOverflow post on how to do it.
But there is one more thing, apart from that post, which Solr-Wiki says:
Solr Joins are not actually joins (in SQL terms), but a way of Inner Query.
Considering your scenario, I assume the two cores ("people" and "jobs") have a common field on which you perform the "join" operation. Lets call it as "id".
Through Solr Join, you will be able to get resulting documents containing fields from either "people" or "jobs" but not a consolidation of fields from both cores.
Hence, it is actually a
select peopleField1, peopleField2 from people where people.id = jobs.id
or
select jobField1, jobField2 from people where people.id = jobs.id
and not a
select peopleField1, peopleField2, jobField1, jobField2 from people, join where people.id = jobs.id
Upvotes: 2