Hi,
 
Sample content:
 
<?xml version="1.0" encoding="UTF-8"?>
<library>
<author name="A">
<book>
<title>Book1</title>
<year>1956</year>
</book>
<book>
<title>Book2</title>
<year>1967</year>
</book>
</author>
<author name="B">
----
--
</author>
</library>
 
XQuery:
 
let $options := <options xmlns="http://marklogic.com/appservices/search";>
<constraint name="facet-on-favorite">
 <range type="xs:gYear" >
 <facet-option>limit=10</facet-option>
<element ns="" name="year"/>
<bucket ge="1950" lt="1960" name="1950s">1950s</bucket>
<bucket ge="1960" lt="1970"  name="1960s">1960s</bucket>
<bucket ge="1970" lt="1980"  name="1970s">1970s</bucket>
<bucket ge="1980" lt="1990"  name="1980s">1980s</bucket>
<bucket gt="1990" lt="2000"  name="1990s">1990s</bucket>
 </range>
</constraint>
</options>
 
return search:search("Book1 facet-on-favorite: 1960s", $options)
 
In this content we have used <year> to form the range constraint and used the 
same as facet. The problem is when we search for the string “Book1” and the 
facet as 1960s the whole document is listed in the search response. I just want 
to get only the part of the document which has “Book1” and year in the range of 
the 1960 to 1970 as search response, not the whole document.
 
Regards,
Mano


      Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! 
http://downloads.yahoo.com/in/internetexplorer/
_______________________________________________
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general

Reply via email to