简体   繁体   English

从mongodb导入solr中的对象树

[英]Import tree of object in solr from mongodb

I have tha follow structure in mongodb: 我在mongodb中具有以下结构:

{
    "status": "1",
    "instancia": "1",
    "infoAdicionais": {
        "partes": [{
            "id": "123"
        }]
    }
}

At schema.xml in solr, how I declare field infoAdicionais ? Solr中的 schema.xml中,如何声明字段infoAdicionais I have tried: 我努力了:

<field name="infoAdicionais" type="text_general" indexed="true" stored="true" docValues="true" />

but not works. 但不起作用。

Thanks. 谢谢。

How are you planning to search that? 您打算如何搜索? When you get your 10 results on a page, what is one of those results? 当您在页面上获得10个结果时,其中一个结果是什么? That should be your Solr document in most cases. 在大多数情况下,这应该是您的Solr文档。

Solr is not a database designed to preserve data structure. Solr不是旨在保留数据结构的数据库。 Solr wants to you modify, combine, split and denormalize data structures to allow you to find information fast. Solr希望您修改,组合,拆分和非规范化数据结构,以使您能够快速找到信息。

If you are not searching partes by ID, you may not even need to preserve it. 如果您不是按ID搜索partes ,则可能甚至不需要保留它。 If you do it, what do you expect to get back? 如果这样做,您希望得到什么? Do you map multiple ids into the same object or different ones? 您是否将多个ID映射到同一对象或不同的ID? These are the questions for you to answer first. 这些是您首先要回答的问题。

As to specifically for the nested structures support, Solr does supports parent and child documents , but the schema is a combined superset of fields from one and from another. 至于专门针对嵌套结构的支持,Solr 确实支持父文档和子文档 ,但是该模式是一个域和另一个域的组合超集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM