Hi
To implement pagination in search application, we need the total number of
search result as input. I am using search:search(). The total attribute of the
search response get differs based on fragmentation.
For the sample content I have provided,
search:search() + with fragmentation : @total=2
search:search() + without fragmentation : @total=1
Please suggest which one I should choose?
Sample content:
<?xml version="1.0" encoding="UTF-8"?>
<library>
<author name="Danielle Steel">
<book>
<title> Accidental Zo</title>
<year>1994</year>
</book>
</author>
<author name="Anne Tyler">
<book>
<title>The Accidental Tourist</title>
<year>1985</year>
</book>
</author>
</library>
search:search("Tourist")
With fragment root “author”:
<search:response
total="2"start="1"page-length="10"xmlns:search="http://marklogic.com/appservices/search">
<search:result
index="1"uri="/Book1.xml"path="doc("/Book1.xml")"score="488"confidence="0.636241"fitness="0.664338">
<search:snippet>
<search:match path="doc("/Book1.xml")/library/author[1]/book/title">
The
<search:highlight>Tourist</search:highlight>
</search:match>
<search:match path="doc("/Book1.xml")/library/author[2]/book/title">
The Accidental
<search:highlight>Tourist</search:highlight>
</search:match>
</search:snippet>
</search:result>
<search:qtext>Tourist</search:qtext>
Without fragment:
<search:response
total="1"start="1"page-length="10"xmlns:search="http://marklogic.com/appservices/search">
<search:result
index="1"uri="/Book1.xml"path="doc("/Book1.xml")"score="638"confidence="0.727472"fitness="0.780482">
<search:snippet>
<search:match path="doc("/Book1.xml")/library/author[1]/book/title">
The
<search:highlight>Tourist</search:highlight>
</search:match>
<search:match path="doc("/Book1.xml")/library/author[2]/book/title">
The Accidental
<search:highlight>Tourist</search:highlight>
</search:match>
</search:snippet>
</search:result>
<search:qtext>Tourist</search:qtext>
Regards,
Mano
________________________________
Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!.
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
http://in.yahoo.com/_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general