Solr:仅从JSON文件导入某些字段

时间:2018-09-04 12:00:20

标签: json solr

我在此结构中有几个JSON文件:

{
  "book" : {
    "truncated" : "true",
    "title": "This is a very long book title and theref"
    "full_title" : "This is a very long book title and therefore it is truncated"
  }
}

或者看起来像这样:

{
  "book" : {
    "truncated" : "false",
    "title": "This is a very short title"
  }
}

我想将这些文件导入Solr 7.4.0。我的schema.xml具有以下定义:

<field name="booktitle" type="string"/>

现在,当我导入数据时,如果full_title为true,我总是要取truncated的内容,否则为title。正确的机制是什么?

0 个答案:

没有答案