简体   繁体   English

具有属性值的 Marklogic TDE 列

[英]Marklogic TDE columns with property values

I'm trying to find out if it is possible to put document properties into a var like last-modified and use them in a value.我试图找出是否可以将文档属性放入像 last-modified 这样的 var 中并在值中使用它们。
However, nothing seems to be able to access the properties.但是,似乎没有任何东西能够访问这些属性。
I am aware the xpath property expression doesn't work but I've been trying to use xdmp:document-properties which I think is supposed to work according to the documentation.我知道 xpath 属性表达式不起作用,但我一直在尝试使用我认为应该根据文档工作的 xdmp:document-properties。
Has anyone tried something like this?有没有人尝试过这样的事情?

TDE are limited in which functions are available, and the context of what is accessible when indexing a particular fragment. TDE 受限于哪些函数可用,以及索引特定片段时可访问的上下文。

You cannot extract index information from a properties fragment while a document fragment is being indexed.在对文档片段进行索引时,您无法从属性片段中提取索引信息。

However, you can write a template that extracts index information from a properties fragment as it is being indexed, just like any other fragment.但是,您可以编写一个模板,在属性片段被索引时从属性片段中提取索引信息,就像任何其他片段一样。

<template xmlns="http://marklogic.com/xdmp/tde">
  <path-namespaces>
    <path-namespace>
      <prefix>prop</prefix>
      <namespace-uri>http://marklogic.com/xdmp/property</namespace-uri>
    </path-namespace>
  </path-namespaces>
  <context>prop:properties</context>
  <rows>
    <row>
      <schema-name>Schema1</schema-name>
      <view-name>View1</view-name>
      <columns>
        <column>
          <name>modified</name>
          <scalar-type>dateTime</scalar-type>
          <val>last-modified</val>
        </column>
      </columns>
    </row>
  </rows>
</template>

Even the MarkLogic xPath extension to the property axis is not supported in TDE. TDE 甚至不支持属性轴的 MarkLogic xPath 扩展。 There is no way to use a single template using properties as Mads has explained.正如 Mads 所解释的那样,无法使用使用属性的单个模板。

However... Step back and consider if you need the properties fragment.但是...退后一步考虑是否需要属性片段。 You could possibly consider using the document metadata feature.您可以考虑使用文档元数据功能。 That content is accessible in the TDE context under https://docs.marklogic.com/xdmp:node-metadata or https://docs.marklogic.com/xdmp:node-metadata-value该内容可在https://docs.marklogic.com/xdmp:node-metadatahttps://docs.marklogic.com/xdmp:node-metadata-value下的 TDE 上下文中访问

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM