[ 
http://issues.apache.org/jira/browse/SOLR-85?page=comments#action_12459240 ] 
            
Thorsten Scherler commented on SOLR-85:
---------------------------------------

Well this issue can be seen as enabler for SOLR-66.

Especially the upload part.
@Yonik, yes the commons-fileupload.jar handles the multi-part posts:

ServletFileUpload upload = new ServletFileUpload(factory);
            // Parse the request
            List iter;
            try {
                iter = upload.parseRequest(request);
            } catch (FileUploadException e) {
                throw new IOException(
                        "FileUploadException\nStack: "
                                + e);
            }

We then  wrap the file and open an input stream, which we pass to the core. 
InputStream stream = item.getInputStream();
commandReader = new BufferedReader(new InputStreamReader(stream));
core.update(commandReader, responseWriter);

I reckon we could test the mime-type  of the file before posting it to the 
core.update.
This way we can generate xml out of csv like in SOLR-66.

So instead making SOLR-66 a servlet on its on it should become something like a 
solr.input.plugin. A input plugin is code that is transforming incoming input 
to solr internal xml markup used fo updates.

Now lets assume the csv has a register input plugin then we need to change 
core.update(commandReader, responseWriter);
to something like
InputPlugin plugin = core.lookupPlugin(stream);
core.update(plugin.getReader(), responseWriter);

The lookup would be done done via a register that contains all input plugins 
and their mime-type pairs. This way one can imagine not only cvs or xml as 
input data. Imagine one want to use a SQL backend to update solr, with a sql 
input plugin that would become an easy task.

the only hard thing is how to auto determine (configure) the plugins used for 
certain streams. As a workaround one could add the plugin as input parameter.

WDYT?

> [PATCH] Add update form to the admin screen
> -------------------------------------------
>
>                 Key: SOLR-85
>                 URL: http://issues.apache.org/jira/browse/SOLR-85
>             Project: Solr
>          Issue Type: New Feature
>          Components: update
>            Reporter: Thorsten Scherler
>         Attachments: solar-85.png, solar-85.png, 
> solar-85.with.file.upload.diff, solr-85.diff, solr-85.diff, solr-85.FINAL.diff
>
>
> It would be nice to have a webform to update solr via a http interface 
> instead of using the post.sh.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to