In general, Search API is designed to work better without fragmentation in 
play. The @total which is estimated (cts:remainder actually) will be more 
accurate that way. -m

On Feb 24, 2010, at 5:57 AM, mano m wrote:

>  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._______________________________________________
> General mailing list
> [email protected]
> http://xqzone.com/mailman/listinfo/general

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

Reply via email to