You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Ryan McKinley <ry...@gmail.com> on 2007/02/01 04:36:05 UTC

empty contentStream?

I'm trying to implement SOLR-85 using SOLR-104 content streams... but
it raises a simple behavior question.

If you have a form:
<form>
 <textarea  name="stream.body"> </textarea>
 <input type="file" name="file"/>
</form>

If you upload a file, the update plugin is sent two content streams:
one with the contents of the file, the other with contents " ".

As written the XmlUpdateHandler parses each stream and breaks when it
hits the empty string.

Options:
1. this should be implemented with two forms - every field sent should be used
2. if stream.body.trim().length() == 0, don't make a stream

I vote for #2, thoughts?

Re: empty contentStream?

Posted by Chris Hostetter <ho...@fucit.org>.
: It makes sure stream.body and stream.url have content before making
: streams out of them.  I think this makes sense given they are likely
: to be used in forms similar to the 'update.jsp' where they may or may
: not have content.

yeah ... good call.


-Hoss


Re: empty contentStream?

Posted by Ryan McKinley <ry...@gmail.com>.
I just posted SOLR-85 using strategy #2.

It makes sure stream.body and stream.url have content before making
streams out of them.  I think this makes sense given they are likely
to be used in forms similar to the 'update.jsp' where they may or may
not have content.

>
> i'm okay with #2 as long as it's only in the stream.body parsing and not
> something we try to do with every stream.
>

I totally agree it should not check 'real' streams, but these are
essentially helper streams that make it easy to post a stream from a
form.

Re: empty contentStream?

Posted by Chris Hostetter <ho...@fucit.org>.
: > 1. this should be implemented with two forms - every field sent should be used
: > 2. if stream.body.trim().length() == 0, don't make a stream
: >
: > I vote for #2, thoughts?
:
: Sigh... yes, it's practical.

Alternate Idea #3: make the XmlUpdateRequestHandler more robust in
recieving empty streams (treat it as a NOOP, maybe return an error if
*all* the streams are empty)

i'm okay with #2 as long as it's only in the stream.body parsing and not
something we try to do with every stream.



-Hoss


Re: empty contentStream?

Posted by Yonik Seeley <yo...@apache.org>.
On 1/31/07, Ryan McKinley <ry...@gmail.com> wrote:
> Options:
> 1. this should be implemented with two forms - every field sent should be used
> 2. if stream.body.trim().length() == 0, don't make a stream
>
> I vote for #2, thoughts?

Sigh... yes, it's practical.

-Yonmik