solr索引嵌套文档

solr索引嵌套文档

问题描述:

solr是否支持嵌套文档?是否有更好的方法来实现此类文档?

Does solr support nested documents? And is there a better way to achieve this sort of document?

<doc>
    <field name="name">Mr. Test</field>
    <field name="case">
        <field name="link">http://foo.com</field>
        <field name="date">1-2-1234</filed>
        <field name="title">My title</filed>
    </field>
    <field name="case">
        <field name="link">http://foo.com/2/</field>
        <field name="date">1-2-1234</filed>
        <field name="title">My title 2</filed>
    </field>
</doc>

我所拥有的是多个案件的一部分。这种形式的模式是否与solr合法?不同的人也可以是同一案件的一部分。所以它看起来像关系数据库的任务,但我在这个项目中使用solr。

What I have is a person that has been part of multiple cases. Is this form of schema legal with solr? A different person can also be part of the same case. So it does look like a task for a relational database, but I'm using solr for this project.

不,Solr不支持嵌套结构。另请参阅这个其他问题

No, Solr doesn't support that nested structure. Have a look at this other question too.