[hibernate-dev] Re: [Hibernate-JIRA] Commented: (HSEARCH-115) Add a default value for indexing null value

Hardy Ferentschik hibernate at ferentschik.de
Wed Apr 23 03:19:52 EDT 2008


On Tue, 22 Apr 2008 18:47:14 +0200, Sanne Grinovero  
<sanne.grinovero at gmail.com> wrote:

> Yes right but I don't see how this is worse than searching for
>  "foo:bar OR foo:NULL-KEYWORD", just some less ambiguity.
>  If you just want to search for null fields, fooIsNull:true

It is not much worse, but as less intuative. One has to know that if  
@IndexNullMarker
is added another field fooIsNull is added. It's less intuative. On the  
other hand would
actually work without ambiguities. I guess one would have to RTFM.


> Interesting I wasn't expecting the index to grow as I remove a Field
>  and replace it with another; I've made a test for this: on 10,000,000
>  docs having 50% a random text value (chosen from 800 constants to
>  limit total string tokens) and 50% nulls the index
>  size grows by 3.5% compared to no null values (same docs and 800  
> consts).
>  I wasn't expecting any growth above some bytes, anyway I think 3.5% is
>  quite good.
If you just add one of the fields (foo or fooIsNull) at the time we are  
fine. It could
be more of an issue if we have always a fooIsNull:false for consistency as  
you mentioned as well.


Nevertheless, I think your idea is still better than the straight forward  
approach. It just comes with
more complexity usage wise.


--Hardy



More information about the hibernate-dev mailing list