You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Erick Erickson <er...@gmail.com> on 2010/08/04 02:46:33 UTC

Should empty xml fields be treated as though they were absent?

This came up on the users list today. Claudio Devecchi defined a date field
in his schema. His XML document had an empty field <field
name="lastsignindate"></field> which caused a SOLR exception. Is it intended
that SOLR treats an empty field differently from it simply not being sent at
all? Or is this just a consequence of how it's coded?

I can argue both ways pretty easily. On the one hand the presence of a field
in the XML implies that a it was sent intentionally and any anomalies should
generate errors. On the other hand the user may not always control how the
xml is produced. I can think of situations pretty easily where I'd want
empty fields just omitted as though they were never sent.

Of course if this were the default, it would change the behavior from what
it is currently, but would anyone notice?

I suppose it could be optional, something like "discardemptyfields=true".
(SOMEBODY come up with a better name).

Mostly, I'm asking this to see if this is intended behavior or not. I can
always raise a JIRA.

Erick

Re: Should empty xml fields be treated as though they were absent?

Posted by Erick Erickson <er...@gmail.com>.
Ahh, thanks. I searched the JIRA, but obviously with the wrong keywords...

That discussion goes right to the heart of the matter.....

Erick

On Wed, Aug 4, 2010 at 12:36 AM, Chris Hostetter
<ho...@fucit.org>wrote:

>
> : name="lastsignindate"></field> which caused a SOLR exception. Is it
> intended
> : that SOLR treats an empty field differently from it simply not being sent
> at
> : all? Or is this just a consequence of how it's coded?
>
> i don't know that it was specificly intended, but it does have it's
> advantages.
>
> The issue of having an optional way to "ignore" empty values has come up
> in the past...
>
>   https://issues.apache.org/jira/browse/SOLR-1772
>
> ...my comments in that issue address a few reasons why i think it would
> make more sense to have it be a new optional UpdateProcessor instead of a
> property of the FieldTypes.
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Should empty xml fields be treated as though they were absent?

Posted by Chris Hostetter <ho...@fucit.org>.
: name="lastsignindate"></field> which caused a SOLR exception. Is it intended
: that SOLR treats an empty field differently from it simply not being sent at
: all? Or is this just a consequence of how it's coded?

i don't know that it was specificly intended, but it does have it's 
advantages.

The issue of having an optional way to "ignore" empty values has come up 
in the past...

   https://issues.apache.org/jira/browse/SOLR-1772

...my comments in that issue address a few reasons why i think it would 
make more sense to have it be a new optional UpdateProcessor instead of a 
property of the FieldTypes.


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org