Sof*_*fia 4 xml xquery marklogic
我有一个元素DateTimeList与PathRangeIndex的第一个子元素,如下所示:
/ ResultPage/DateTimeList /日期时间[1]
通常我们用属性对元素进行排序,如下所示:
<sort-order type="xs:string" direction="ascending">
<element ns="" name="div"/>
<attribute ns="" name="order"/>
</sort-order>
Run Code Online (Sandbox Code Playgroud)
是否有任何类似的方法来使用其第一个子元素(使用path-range-index)对DateTimeList元素进行排序.我尝试如下:
<sort-order direction="ascending" type="xs:dateTime">
<path-index>/ResultPage/DateTimeList/DateTime[1]</path-index>
</sort-order><sort-order><score/></sort-order></state></operator>
Run Code Online (Sandbox Code Playgroud)
但得到的结果没有变化如下:
<DateTimeList>
<DateTime>2014-05-07T10:26:00</DateTime>
</DateTimeList>
<DateTimeList>
<DateTime>2013-12-01T00:00:00</DateTime>
<DateTime>2014-05-01T00:00:00</DateTime>
<DateTime>2014-12-01T00:00:00</DateTime>
</DateTimeList>
<DateTimeList>
<DateTime>2013-09-01T10:32:42</DateTime>
</DateTimeList>
<DateTimeList>
<DateTime>2014-05-30T00:00:00</DateTime>
<DateTime>2015-05-30T00:00:00</DateTime>
</DateTimeList >
Run Code Online (Sandbox Code Playgroud)
谢谢.
小智 5
当前版本MarkLogic Search API实际上不支持按路径索引进行排序.但是,您构建了一个表达式,只要产品中有该支持,它就会起作用.有计划介绍它.
我建议您使用search:check-options($options)以查看您的选项是否有效.我相信在这种情况下,check-options将报告该节点无效.
| 归档时间: |
|
| 查看次数: |
423 次 |
| 最近记录: |