Paging for edges in Marklogic
I am getting faces for a give search string using
search:search($q, $options)
Where $q is the search text
and $options
there
<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 first five after the first three to simulate paging. But the option skip
doesn't work here.
Is there a way to do this using the search api, or is my only option to use cts queries
source to share
If you want to list the values ββin the range index, you can also take a look at search:values()
:
http://docs.marklogic.com/search:values
You will need to use search:search()
to parse the query.
Alternatively, you can use cts:parse()
- which takes a slightly different approach to parsing the query text - and cts:values()
orcts:value-ranges()
Hope it helps,
source to share