Marklogic属性范围索引范围

时间:2016-03-15 07:37:50

标签: indexing marklogic marklogic-8

我正在使用属性" ID"在我的搜索查询中。所以我打算为属性" ID"创建属性范围索引。对于以下示例XML。

 <head>
    <title>
    <note ID=20 >1</note>
      <to>Tove</to>
      <from>Jani</from>
      <heading>Reminder</heading>
      <body>Don't forget me this weekend!</body>
      </title>
    </head>

我的问题是我需要将哪个标记(<Head> or <Title> or <Note>)称为&#34;父母本地名称&#34;发挥最大作用。

2 个答案:

答案 0 :(得分:0)

note元素,因为ID是此元素中的属性

答案 1 :(得分:0)

<head><title>代码不包含任何属性,该属性属于<note>代码。 此外,您可以通过此

查询此属性范围索引
cts:search(//head,
    cts:element-attribute-value-query(
      xs:QName("note"),
      xs:QName("ID"),
      "20"))