[hibernate-dev] Re: [Hibernate-JIRA] Commented: (HSEARCH-115) Add a default value for indexing null value
Hardy Ferentschik
hibernate at ferentschik.de
Tue Apr 22 04:18:12 EDT 2008
On Tue, 22 Apr 2008 03:29:18 +0200, Sanne Grinovero
<sanne.grinovero at gmail.com> wrote:
> A new proposal:
> I got inspired by the "3VL" considerations described in Emmanuel's
> link to wikipedia, and think backwards compatibility is nice:
> add a "@IndexNullMarker" on the property, this will add an additional
> Field to the index for null values:
Hmm, interesting idea. It addresses one of the biggest concerns I have
with this null marker thing, namely ambiguities. But would querying look
like in this
case. Wouldn't it become harder? Whenever you want to use this feature you
would have
to combine two fields - foo and fooIsFalse - within a boolean query to get
the expected
result. Something like this: "foo:bar OR fooIsNull:true".
Of course it would also mean that the index size grows since we are adding
more fields.
And the bigger the index, ...
> The Field and StringBridge API would remain as-is;
> If you prefer not to add an additional @IndexNullMarker could be
> dropped if you think adding this field is acceptable for all fields.
I think it should stay an optional and explicit feature. Adding one
addtional field for
each indexed properties does not seem justified. Especially, since we
agree that
the best solution would be to re-think your design and come up with a
proper
non-null default. So by offering this feature we might end up encouraging
people
to stick with there less optimal design ;-)
Cheers,
Hardy
More information about the hibernate-dev
mailing list