2017-07-07 43 views
0

任何人都可以帮助我解释如何索引嵌套文档?使用弹簧数据的Solr的最新版本我',我有一个列表的文档和annoted如下:如何索引使用弹簧索引数据的嵌套文件

@Indexed(required = true,stored = true) 
@Field(child = true,value = "werkzeuge") 
private List<Werkzeug> werkzeuge; 

但是Solr的内部文件没有现场WERKZEUGE。

Iam使用SOLR无模式配置。

非常感谢,

回答

0

嵌套文件支持最近已加入到春季数据Apache Solr实现。在撰写本文时,仅提供此功能的快照构建。有关详细信息,请参阅DATASOLR-394documentation

0

很多感谢您对示例项目的回答和参考。现在它适用于我,但似乎嵌套对象的结构仍然是平坦的。该框架会生成根域字段标识,但所有字段都处于相同的层次结构中。一个例子:WERKZEUG是父对象

{ 
    "werkzeug_id":"116283s", 
    "id_werkzeug":"", 
    "werkzeug_zitiernr":"s019910", 
    "werkzeug_kyrissnr":"", 
    "werkzeug_internnr":"069.02", 
    "werkzeug_floerke":"", 
    "werkzeug_laenge":0, 
    "werkzeug_breite":23, 
    "werkzeug_form":"Herz, umrandet", 
    "werkzeug_stecher":"", 
    "werkzeug_beschriftung":"", 
    "werkzeug_image":"s0192202", 
    "werkzeug_literatur":"", 
    "werkzeug_freitext":"", 
    "werkzeug_erfname":"", 
    "werkzeug_erfdatum":"2004-12-10T13:11:13Z", 
    "werkzeug_korrname":"", 
    "werkzeug_publicity":"public", 
    "_root_":"205789s"}, 
    { 
    "id":"205789s", 
    "all":["205789s"], 
    "signatur":"Inc.fol.7541", 
    "id_standort":58, 
    "sovermerk":"ok", 
    "erfdatum":"2004-12-10T14:33:10Z", 
    "korrname":"wlb", 
    "korrdatum":"Thu Nov 13 13:31:22 UTC 2014", 
    "publicity":"public", 
    "_version_":1573171122990481408, 
    "_root_":"205789s"}]} 

取而代之的是它应该看起来像这样的孩子?

[ 
{id : book1, type_s:book, title_t : "The Way of Kings", author_s : "Brandon 
Sanderson", 
    cat_s:fantasy, pubyear_i:2010, publisher_s:Tor, 
    _childDocuments_ : [ 
    { id: book1_c1, type_s:review, review_dt:"2015-01-03T14:30:00Z", 
    stars_i:5, author_s:yonik, 
    comment_t:"A great start to what looks like an epic series!" 
    } 
, 
{ id: book1_c2, type_s:review, review_dt:"2014-03-15T12:00:00Z", 
    stars_i:3, author_s:dan, 
    comment_t:"This book was too long." 
    } 
]}] 

你有什么想法可能是什么原因?