I have 10 documents loaded in Mark Logic, each containing information about
a single book. Below is a sample document.
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://www.sb.com/namespaces/sb";>
<title>The Life of David Gale</title>
<genre>fiction</genre>
<desc>....</desc>
<review>...</review>
</book>

My search goes against the entire document but I want it to apply a higher
weight to matches in the TITLE as opposed to DESC. I have read the
documentation but it isn't clear how I can get that to happen.

Below is my search code using the new search API.

xquery version "1.0-ml";
import module namespace search = "http://marklogic.com/appservices/search";
at "/MarkLogic/appservices/search/search.xqy";
search:search("life",
<options xmlns="http://marklogic.com/appservices/search";>
  <constraint name="facet-on-genre">
      <range type="xs:string" facet="true">
          <facet-option>limit=10</facet-option>
          <element ns="http://www.sb.com/namespaces/sb"; name="genre"/>
      </range>
  </constraint>
</options>)

Surajit
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to