如何在 Apache Nifi Process 属性 中使用表达式语言获取所有值
How to get all values with expression language in Apache Nifi Process Property
我正在尝试创建一个 Apache Nifi 模型,它允许我从 Elasticsearch 中读取所有数据并将其存储到一个文件中。我已正确连接所有内容,但我遇到的问题是 FetchElasticsearch 进程需要文档标识符(它应该如此),但我想获取索引中的每个项目,而不仅仅是搜索 ID 为 1 的文档。我知道 Nifi 和进程 属性 支持表达式语言所以我尝试简单地使用一个正则表达式来匹配所有应该是
的字符
${'*'}
但是我在执行此操作时收到警告,因为该过程实际上查找的是 * 的文字文档 ID,这当然不存在。以下是屏幕截图,希望它能帮助理解我的问题。
我正在搜索 localhost:9300/tweet_library/tweet/(正则表达式)
所以我想要 tweet_library 中的所有文档。感谢您的帮助,谢谢。
霍顿作品社区的回答:
"The FetchElasticsearch processor uses the Get API, which requires a single document identifier and doesn't support regular expressions. As an alternative, you can use InvokeHttp to call the Multi-Get API or the Search API, which give you more control over the retrieval of multiple documents."
我正在尝试创建一个 Apache Nifi 模型,它允许我从 Elasticsearch 中读取所有数据并将其存储到一个文件中。我已正确连接所有内容,但我遇到的问题是 FetchElasticsearch 进程需要文档标识符(它应该如此),但我想获取索引中的每个项目,而不仅仅是搜索 ID 为 1 的文档。我知道 Nifi 和进程 属性 支持表达式语言所以我尝试简单地使用一个正则表达式来匹配所有应该是
的字符${'*'}
但是我在执行此操作时收到警告,因为该过程实际上查找的是 * 的文字文档 ID,这当然不存在。以下是屏幕截图,希望它能帮助理解我的问题。
我正在搜索 localhost:9300/tweet_library/tweet/(正则表达式) 所以我想要 tweet_library 中的所有文档。感谢您的帮助,谢谢。
霍顿作品社区的回答:
"The FetchElasticsearch processor uses the Get API, which requires a single document identifier and doesn't support regular expressions. As an alternative, you can use InvokeHttp to call the Multi-Get API or the Search API, which give you more control over the retrieval of multiple documents."