json - Solr:仅从 JSON 文件中导入某些字段
问题描述
我在这个结构中有几个 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
,如果truncated
为真,否则title
。正确的机制是什么?
解决方案
推荐阅读
- wordpress - WordPress 自定义分类法 - 哎呀!找不到该页面 - 错误 404
- python - 在 PowerPoint 中创建“PicturePlaceholder”并使用 Python-pptx 访问它
- java - Java 通过添加特定的小时数来计算时间,但只考虑工作时间和非周末日
- java - 错误:在 Android Studio 中找不到符号类
- java - 如何从输入标签中禁用?
- javascript - 使用索引在 jquery 上设置值
- node.js - 在节点脚本中按顺序运行一组纱线命令
- wordpress - Woocommerce 自定义子页面
- pandas - 在循环内创建多个循环的数据框以进行半正弦地理定位
- angular - Angular - 加载资源失败:服务器在注册确认中响应状态为 404(未找到)