2016-03-15 109 views
1

我在我的搜索查询中使用属性“ID”。所以我打算为下面的示例XML创建属性“ID”的属性范围索引。Marklogic属性范围索引范围

<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>)指为“父本地名称”来获得最大的效果。

回答

0

note元件,因为ID是这个元素

+0

谢谢,我会试试这个。 – Antony

0

<head><title>或标签不包含任何属性中的属性,所述属性属于<note>标签。 此外,您可以通过此查询此属性范围索引

cts:search(//head, 
    cts:element-attribute-value-query(
     xs:QName("note"), 
     xs:QName("ID"), 
     "20"))