[ 
https://issues.apache.org/jira/browse/SOLR-284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541535
 ] 

Juri Kuehn commented on SOLR-284:
---------------------------------

Hi Eric, thank you for this handler, works like a charm!
I need to use non-numeric ids which are fine with solr but are rejected by 
RichDocumentRequestHandler. I'm not familiar with the solr-code, i patched 
RichDocumentRequestHandler.java to not to convert id to int, which didn't cause 
trouble so far:

{code:title=RichDocumentRequestHandler.java.patch}
Index: RichDocumentRequestHandler.java
===================================================================
--- RichDocumentRequestHandler.java     (revision 0)
+++ RichDocumentRequestHandler.java     (working copy)
@@ -133,7 +133,7 @@
        String streamFieldname;
        String[] fieldnames;
        SchemaField[] fields;
-       int id;
+       String id;
          
        final AddUpdateCommand templateAdd;
 
@@ -153,7 +153,7 @@
            String fn = params.get(FIELDNAMES);
            fieldnames = fn != null ? commaSplit.split(fn,-1) : null;
            
-           id = params.getInt(ID);
+           id = params.get(ID);
 
                templateAdd = new AddUpdateCommand();
                templateAdd.allowDups = false;
@@ -202,7 +202,7 @@
         * @param desc
         *            TODO
         */
-       void doAdd(int id, String text, DocumentBuilder builder, 
AddUpdateCommand template)
+       void doAdd(String id, String text, DocumentBuilder builder, 
AddUpdateCommand template)
        throws IOException {
 
          // first, create the lucene document
@@ -225,7 +225,7 @@
          handler.addDoc(template);
        }
 
-       void addDoc(int id, String text) throws IOException {
+       void addDoc(String id, String text) throws IOException {
                templateAdd.indexedId = null;
                doAdd(id, text, builder, templateAdd);
        }
{code}

Tests were ok, maybe you can apply it to your sources.

Best regards,
Juri

> Parsing Rich Document Types
> ---------------------------
>
>                 Key: SOLR-284
>                 URL: https://issues.apache.org/jira/browse/SOLR-284
>             Project: Solr
>          Issue Type: New Feature
>          Components: update
>    Affects Versions: 1.3
>            Reporter: Eric Pugh
>             Fix For: 1.3
>
>         Attachments: libs.zip, rich.patch, source.zip, test-files.zip, 
> test.zip
>
>
> I have developed a RichDocumentRequestHandler based on the CSVRequestHandler 
> that supports streaming a PDF, Word, Powerpoint, Excel, or PDF document into 
> Solr.
> There is a wiki page with information here: 
> http://wiki.apache.org/solr/UpdateRichDocuments
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to