Python 如何将子文档添加到Solr上现有的父结构中?
我正在使用Pysolr为以下结构编制索引。已成功为其编制索引Python 如何将子文档添加到Solr上现有的父结构中?,python,json,solr,parent-child,pysolr,Python,Json,Solr,Parent Child,Pysolr,我正在使用Pysolr为以下结构编制索引。已成功为其编制索引 l = [{'id': 1, 'name': 'John Smith', 'type': 'person', '_childDocuments_': [{'id': 'text1', 'language': 'nl', 'text': ' John Smith has worked on many projects for the company'}]}] 我只想为另外一个子文档编制索引,以获得Sol
l = [{'id': 1,
'name': 'John Smith',
'type': 'person',
'_childDocuments_': [{'id': 'text1',
'language': 'nl',
'text': ' John Smith has worked on many projects for the company'}]}]
我只想为另外一个子文档编制索引,以获得Solr中的以下结构:
[{'id': 1,
'name': 'John Smith',
'type': 'person',
'_childDocuments_': [{'id': 'text1',
'language': 'en',
'text': ' John Smith has worked on many projects for the company'},
{'id': 'text2', 'language': 'en', 'text': 'The one in charge for this is John Smith'}]}]
我的代码用于索引上面显示的第一个结构:
solr = pysolr.Solr('http://localhost:8983/solr/core_example', always_commit=True)
solr.add(l)
我不认为有任何人支持这样做-看到了吗