在Marklogic中寻找方面

时间:2017-06-07 18:33:07

标签: marklogic marklogic-8

我正在使用

获取给定搜索字符串的方面
search:search($q, $options)

$q is the search text$options

<options xmlns="http://marklogic.com/appservices/search">
  <constraint name="kn_entry_number">
    <range type="xs:string" facet="true">
      <facet-option>frequency-order</facet-option>
      <facet-option>descending</facet-option>
      <facet-option>limit=5</facet-option>
      <facet-option>skip=3</facet-option>
      <field name="kn_entrynumber">
      </field>
    </range>
  </constraint>
  <return-results>false</return-results>
  <return-facets>true</return-facets>
</options>

我希望在前三名之后获得前五名,以便模仿分页。但是skip选项在这里似乎不起作用。

有没有办法使用搜索API执行此操作,或者我唯一的选择是使用cts queries

1 个答案:

答案 0 :(得分:1)

如果您想翻页范围索引中的值,您还可以查看search:values()

http://docs.marklogic.com/search:values

您必须使用search:search()来解析查询。

或者,你可以使用cts:parse() - 它采用一种不同的方法来解析查询文本 - 以及cts:values()cts:value-ranges()

希望有帮助,

相关问题