solr JOIN查询(solr JOIN query)
我需要在solr索引上运行JOIN查询。 我有两个已编入索引的xmls,person.xml和subject.xml。
人:
<doc> <field name="id">P39126</field> <field name="family">Smith</field> <field name="given">John</field> <field name="subject">S1276</field> <field name="subject">S1312</field> </doc>
学科:
<doc> <field name="id">S1276</field> <field name="topic">Abnormalities, Human</field> </doc>
我只需要显示来自人员文档的信息,但每个查询应该与人和主题中的字段匹配。 如果查询仅匹配主题文档,我需要显示具有匹配ID的人员的所有文档。 这可以不运行两个单独的查询吗? 像JOIN查询之类的东西可以胜任。
有帮助吗?
I need to run a JOIN query on a solr index. I've got two xmls that I have indexed, person.xml and subject.xml.
Person:
<doc> <field name="id">P39126</field> <field name="family">Smith</field> <field name="given">John</field> <field name="subject">S1276</field> <field name="subject">S1312</field> </doc>
Subject:
<doc> <field name="id">S1276</field> <field name="topic">Abnormalities, Human</field> </doc>
I need to only display information from the person doc but each query should match fields in both person and subject. In the case the query matches only the subject doc I need to display all docs from the person that have a matching id. Is this possible to do without running two seperate queries? Something like a JOIN query would do the job.
Any help?
原文:https://stackoverflow.com/questions/2636637