On Fri, Jan 14, 2011 at 5:20 AM, Wichert Akkerman <wich...@wiggy.net> wrote:
> This may already be different in the trunk of repoze.catalog, but I just
> stumbled over this: when you do a catalog search and ask it to order by an
> empty index you get an empty result set. I was expecting the result to be an
> unordered result for that situation. Is this expected behaviour?
I haven't observed this behavior, but it seems like an undefined case, to
me. I'm not sure what I would expect it to do in such a situation.
Supposing you have a set of documents you want sorted by an index and the
index contains only a subset of those documents? It seems to me the case is
undefined--I would have a tendency to raise an exception, personally.
I think in the interest of a well defined determinism I would suggest that
if you are using an index to sort, you should make sure that the
discriminator for that index be able to return some value for any document.
This way even if logically, to you, the document doesn't really have a
value for that index, you can at least be deterministic about how it will be
Repoze-dev mailing list