Marklogic 如何使用ApacheNIFI中的查询标记逻辑处理器在结构化查询中使用变量/函数?
我想查询集合中最近3分钟内更新的文档的marklogic 我曾尝试为该需求编写结构化查询,但它只接受dateTime的硬编码值,而不接受fn:current-dateTime()函数。下面是我试过的Marklogic 如何使用ApacheNIFI中的查询标记逻辑处理器在结构化查询中使用变量/函数?,marklogic,apache-nifi,Marklogic,Apache Nifi,我想查询集合中最近3分钟内更新的文档的marklogic 我曾尝试为该需求编写结构化查询,但它只接受dateTime的硬编码值,而不接受fn:current-dateTime()函数。下面是我试过的 <query xmlns="http://marklogic.com/appservices/search"> <and-query> <collection-query> <uri>live<
<query xmlns="http://marklogic.com/appservices/search">
<and-query>
<collection-query>
<uri>live</uri>
</collection-query>
<range-query type="xs:dateTime">
<element ns="" name="created-on"/>
<value>2019-06-10T10:36:14.002101Z</value>
<range-operator>GT</range-operator>
</range-query>
</and-query>
</query>
居住
2019-06-10T10:36:14.002101Z
燃气轮机
我期待这样的事情-
<query xmlns="http://marklogic.com/appservices/search">
<and-query>
<collection-query>
<uri>live</uri>
</collection-query>
<range-query type="xs:dateTime">
<element ns="" name="created-on"/>
<value>{fn:current-dateTime() - xs:dayTimeDuration("PT3M")}</value>
<range-operator>GT</range-operator>
</range-query>
</and-query>
</query>
居住
{fn:current-dateTime()-xs:dayTimeDuration(“PT3M”)}
燃气轮机
您可以在QueryMarklogic
处理器的查询属性中使用任何格式填充当前时间
比如:
<query xmlns="http://marklogic.com/appservices/search">
<and-query>
<collection-query>
<uri>live</uri>
</collection-query>
<range-query type="xs:dateTime">
<element ns="" name="created-on"/>
<value>${now():minus(180000):format('YYYY-MM-dd HH:mm:ss.SSS')}</value>
<range-operator>GT</range-operator>
</range-query>
</and-query>
</query>
.