Hi,

I am using search:search() and using the search:response/@total value to 
indicate the number of hits. The searches are running with filtering turned on.


When offsetting within the results, so that start < total, the reported total 
seems to be reliable. However, if the start value exceeds the known total, the 
Search API is returning zero for the total.


This is only happening in larger databases with many fragments. If I attempt 
the same on a database with only a few dozen fragments, I always get a reliable 
total even when offsetting past the end.


I realise that the Search API will use cts:remainder() to calculate the total 
when it has at least one result to work with. If the search returns no results, 
because of the query or paging too far, it resorts to using xdmp:estimate() to 
get the total.


So given that the query does return results, how is the xdmp:estimate() failing 
to get a count? If I run the xdmp:estimate() by hand, using the cts:query() 
that the Search API would run, I do get a proper count!


By the way, it is no better if the query narrows the result set down to very 
few such as 10. if you set start to 11 the total becomes zero.


Has anybody encountered this before, and is there a way to correct it?


Regards,

Gavin


Gavin Haydon

Technical Team Leader

PRESS
ASSOCIATION

www.pressassociation.com<http://www.pressassociation.com/>

[email protected]??



This email is from the Press Association. For more information, see 
www.pressassociation.com. This email may contain confidential information. Only 
the addressee is permitted to read, copy, distribute or otherwise use this 
email or any attachments. If you have received it in error, please contact the 
sender immediately. Any opinion expressed in this email is personal to the 
sender and may not reflect the opinion of the Press Association. Any email 
reply to this address may be subject to interception or monitoring for 
operational reasons or for lawful business practices.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to