在Apache NiFi中,可以使用EvaluateJsonPath处理器来获取Solr配置时不包含日期字段的解决方法。下面是一个示例流程:
下面是一个示例的NiFi流程的JSON配置:
{
"name": "Solr Configuration",
"id": "4f8a0e4a-0157-1000-ffff-ffffa5d0d8fd",
"comments": "Solr Configuration",
"isolated": false,
"inputRequirement": "INPUT_REQUIRED",
"config": {
"properties": {
"SolrUrl": "http://localhost:8983/solr",
"SolrCollection": "mycollection"
}
},
"component": {
"name": "GetSolr",
"type": "org.apache.nifi.processors.solr.GetSolr",
"id": "4f8a0e4a-0157-1000-ffff-ffffa5d0d8fd",
"bundle": {
"group": "org.apache.nifi",
"artifact": "nifi-solr-nar",
"version": "1.13.2"
}
},
"connections": [
{
"id": "4f8a0e4a-0157-1000-ffff-ffffa5d0d8ff",
"source": {
"id": "4f8a0e4a-0157-1000-ffff-ffffa5d0d8fd",
"relationship": "success"
},
"destination": {
"id": "4f8a0e4a-0157-1000-ffff-ffffa5d0d8fe",
"relationship": "success"
},
"flowFileExpiration": "0 sec",
"backPressureDataSizeThreshold": "1 GB",
"backPressureObjectThreshold": "10000",
"bends": [
]
}
],
"processGroups": [
],
"remoteProcessGroups": [
],
"labels": [
],
"funnels": [
],
"controllerServices": [
],
"idGenerationSeed": 1,
"position": {
"x": 273.0,
"y": 64.0
}
}
请注意,以上示例中的日期字段名称为"dateField",你需要根据你的实际情况进行相应的更改。