Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created September 2, 2016 07:04
Show Gist options
  • Save ableasdale/3cf3ba872f2a12ef32fe2d6af5bce415 to your computer and use it in GitHub Desktop.
Save ableasdale/3cf3ba872f2a12ef32fe2d6af5bce415 to your computer and use it in GitHub Desktop.
Using search:search to resolve at document fragment scope
xquery version "1.0-ml";
import module namespace search = "http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy";
search:search("term",
<options xmlns="http://marklogic.com/appservices/search">
<debug>true</debug>
<fragment-scope>properties</fragment-scope>
<sort-order type="xs:string"
collation="http://marklogic.com/collation/"
direction="ascending">
<element ns="" name="product-types"/>
</sort-order>
</options>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment