Hi Bruce, For raw speed, the Search API uses cts:remainder() to quickly get an estimated number for the total. Are you using fragment roots by chance? That can cause the specific number to vary, much like with search engine results.
The specific calculation is cts:remainder( of first result ) + $start - 1. If the underlying call returns different values, so will what you see in the Search API results. Thanks, -m On Sep 23, 2009, at 11:05 AM, Bruce Holt wrote: > Hello All. > > I am using the search:search api and everything works as expected > until I sort by an element or attribute in my document. Once I sort > by an element or attribute, the @total for <search:response> changes > as I paginate through the results. I have several <article> documents > that I am searching through with an Integer Attribute Range Index on > "authorRole/@rank". When I add <sort-order type="xs:integer" > direction="ascending"> > <element ns="" name="authorRole"/> > <attribute ns="" name="rank"/> > </sort-order> > to my search options, the @total is no longer accurate. For a search > with 99 hits, paging through the results changes @total from 21 to 147 > results. Any Ideas? An example <article> document is below. > > <article status="publish"> > <referenceHeader> > <publicationDate > value="2008-11-01T00:00:00">2008-11-01</publicationDate> > <searchTerms> > <authorRole rank="6" seniority="1">Role ABC</authorRole> > <collection>misc</collection> > </searchTerms> > <lastChanged> > <editor>John Smith</editor> > <dateStamp>2008-10-23</dateStamp> > </lastChanged> > <itemNumber>62291</itemNumber> > </referenceHeader> > <titleBlock> > <title id="1">The Title</title> > <kicker id="4">This is very interesting.</kicker> > </titleBlock> > <bodyBlock> > <para id="5" start="00:00:00:00" stop=""><pageBreak > pageNum="75"/>This is paragraph 1 and > that is all I have to say here.</para> > <para id="6" start="00:00:00:00" stop="">Yes! Another > paragraph.</para> > </bodyBlock> > <publishDate value="2009-07-22T09:52:48.887-06:00">2009-07-22</ > publishDate> > </article> > > > Thanks, > > Bruce Holt > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
