[zope2-tracker] [Bug 1237141] [NEW] Sorted ZCatalog results report incorrect actual_result_count

Alec Mitchell 1237141 at bugs.launchpad.net
Wed Oct 9 02:05:42 CEST 2013


Public bug reported:

When some results in a search result set do not have a value set for the
sort index, those results are excluded by the sortResults() method in
Catalog.py.  This is a longstanding behavior, and isn't entirely
unreasonable.  However, the result count attached to the final results
(actual_result_count) is not adjusted for the excluded results, so the
length of the sequence may be shorter than its reported "actual" length.
See:

https://github.com/zopefoundation/Products.ZCatalog/blob/2.13/src/Products/ZCatalog/Catalog.py#L769

The simplest solution would be to decrement the actual_result_count
variable in that except block, but I'm not sure if doing so would be
entirely safe or cover all cases where this issue might arise.  There
are a number of code paths based on different optimization strategies
here.

** Affects: zope2
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.
https://bugs.launchpad.net/bugs/1237141

Title:
  Sorted ZCatalog results report incorrect actual_result_count

To manage notifications about this bug go to:
https://bugs.launchpad.net/zope2/+bug/1237141/+subscriptions


More information about the zope2-tracker mailing list