2017-07-07 74 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." 
    } 
]}] 

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