[Zope-dev] Hey Chris, question for you

Michel Pelletier michel@digicool.com
Tue, 26 Jun 2001 15:42:40 -0700 (PDT)


On Tue, 26 Jun 2001, Casey Duncan wrote:

> Ok, I was able to get it to work by instantiating a IISet around
> _unindex.keys() and passing that to difference (Thanks!), however, I
> notice an interesting side effect. Let's say you have a TextIndex on
> title and you do the following query:
>
> title != 'foo*'
>
> Which to me means: "all cataloged objects whose title do not match the
> substring 'foo*'"
>
> However, this is not what you get exactly, instead you get:
>
> "all cataloged objects that have a non-empty title that does not match
> the substring 'foo*'"
>
> Because from what I am seeing, objects with empty (or no) titles are not
> included in the index *at all*. So the set of "all objects" does not
> include ones without titles. I could fix this by making all objects be
> instead "All objects in the catalog" (via catalog.data.keys()) instead
> of "all objects in the index", but I wanted to see if anyone had
> additional thoughts about this.

Hmm the reason for the current behavior was optimization by saving space
not indexing empty values.  The problem with your latter aproach is that
"all objects in the catalog" may include object that don't have a title
attribute at all.

I'm not against indexing empty values though.

-Michel