On Wed, Nov 4, 2009 at 12:04, Jerome Velociter <[email protected]> wrote:
> Hi Sergiu, all
>
> I see in the XWikiHibernateStore that #countDocuments do distinct
> documents by language while #searchDocuments does not.
>
> I would have expect both to have the same behavior, so that we can use
> them safely using the same query as input (for example for pagination).
>
> Is there a reason for originally doing "select count(*)" versus select
> "count(distinct doc.fullName)" ?

It looks like a bug to me.

According to javadoc ("API allowing to count the total number of
documents that would be returned by a query.") countDocuments is
supposed to return the same thing that searchDocuments().size().

If the javadoc say it it's fine to fix it IMO, it's not like old
undocumented methods.

>
> I think in any case we should have this API that does not distinct by
> language. Should it replace the current behavior ? or should we add a
> new API #countDocuments(String wheresql, boolean distinctFullname,
> XWikiContext context) ?
>
> Thanks,
> Jerome.
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>



-- 
Thomas Mortagne
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to