3

I am getting the facets for a give search string using

search:search($q, $options)

Where $q is the search text and $options is

<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>

I want to get the top 5 after the top 3, so as to mimic the paging. But skip option does not seem to work here.

Is there any way of doing this using the search api, or my only option is to use cts queries

Ravi
  • 1,179
  • 6
  • 13

1 Answers1

1

If you want to page over the values in a range index, you could also take a look at search:values():

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

You would have to use search:search() to parse the query.

Alternatively, you could use cts:parse() -- which takes a somewhat different approach to parsing query text -- and cts:values() or cts:value-ranges()

Hoping that helps,

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
ehennum
  • 7,295
  • 13
  • 9