我有某种问题,我无法按照文档解决它。我有这个自定义 JSON,我无法将其展平,因为它来自外部来源。我省略了部分代码以使其易于阅读和理解。这是我要索引的文档:
{
"status": "ok",
"message": {
... some other fields ...
"title": "The good and the bad",
"editor": [
{"given": "Bianca", "family": "Racioppe", "sequence": "additional", "affiliation": [] },
{"given": "Virginia", "family": "C\u00e1neva", "sequence": "additional", "affiliation": []}],
... other fields ...
}}
这是我的架构:
<field name="editors" type="string" multiValued="true" indexed="true" stored="true">
<field name="given_name" type="string" indexed="true" stored="true"/>
<field name="family_name" type="string" indexed="true" stored="true"/>
<field name="affiliation" type="string" multiValued="true" indexed="true" stored="true"/>
<field name="orcid" type="string" indexed="true" stored="true"/>
</field>
<field name="title" type="string" multiValued="false" indexed="true" stored="true"/>
<field... other fields ... />
我也试过 <field name="editors.given_name".... />
我正在映射的是:
curl -X POST "http://localhost:8983/solr/papers/update/json/docs?
split=/message|/message/autor|/message/editor
&f=editors:/message/editor
&f=editors.given_name:/message/editor/given
&f=editors.family_name:/message/editor/family
&f=editors.affiliation:/message/editor/affiliation/name
&f=title:/message/title
&f=.... other fields....
&commit=true" -H 'Content-type:application/json' --data-binary @file.json
索引对除“编辑器”字段之外的所有字段都有效,没有任何反应!我做错了什么或错过了什么?
谢谢。