ezsystems/ezpublish-kernel — pull request #640 by lolautruche (2013-12-02 10:29:40+00:00)
Title: [WIP] Fix EZP-21906: Search API returns wrong number of total objects with content having multiple locations

https://jira.ez.no/browse/EZP-21906

When running a query with Search API, if one of the returned content objects has multiple locations, `SearchResult->totalCount` is wrong. It's superior to the actual number of results.
Even more, when using `LocationPriority` sort clause, `totalCount` is even greater.

[Script to reproduce](https://gist.github.com/lolautruche/27db1c1d2999c0e4554f)