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

Hoss Man commented on SOLR-3657:
--------------------------------

Info from solr-user...

{noformat}
schema.xml:
<types>...
                <fieldtype name="text_not_empty" class="solr.TextField">
                        <analyzer>
                                <tokenizer class="solr.KeywordTokenizerFactory" 
/>
                                <filter class="solr.TrimFilterFactory" />
                                <filter class="solr.LengthFilterFactory" 
min="1" max="20" />
                        </analyzer>
                </fieldtype>
</types>

<fields>...
                <field name="estimated_hours" type="tfloat" indexed="true" 
stored="true" required="false" />
                <field name="s_estimated_hours" type="text_not_empty" 
indexed="false" stored="false" />
</fields>

        <copyField source="s_estimated_hours" dest="estimated_hours" />

...

WARNUNG: Error creating document : SolrInputDocument[{id=id(1.0)={2930},
s_estimated_hours=s_estimated_hours(1.0)={}}]
org.apache.solr.common.SolrException: ERROR: [doc=2930] Error adding field 
's_estimated_hours'=''
        at 
org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:333)
        at 
org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:60)
        at 
org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:115)
        at 
org.apache.solr.handler.dataimport.SolrWriter.upload(SolrWriter.java:66)
        at 
org.apache.solr.handler.dataimport.DataImportHandler$1.upload(DataImportHandler.java:293)
        at 
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:723)
        at 
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:619)
        at 
org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:327)
        at 
org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:225)
        at 
org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:375)
        at 
org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:445)
        at 
org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:426)
Caused by: java.lang.NumberFormatException: empty String
        at 
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:992)
        at java.lang.Float.parseFloat(Float.java:422)
        at org.apache.solr.schema.TrieField.createField(TrieField.java:410)
        at org.apache.solr.schema.FieldType.createFields(FieldType.java:289)
        at org.apache.solr.schema.SchemaField.createFields(SchemaField.java:107)
        at 
org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:312)
        ... 11 more
{noformat}

My response...

{quote}
I believe this is intentional, but i can understand how it might be confusing.

I think the point here is that since the field submitted by the client was 
named "s_estimated_hours" that's the field used in the error reported back to 
the client when something goes wrong with the copyField -- if the error message 
refered to "estimated_hours" the client may not have any idea why/where that 
field came from.

But i can certainly understand the confusion, i've opened SOLR-3657 to try and 
improve on this.  Ideally the error message should make it clear that the 
"value" from "source" field was copied to "dest" field which then encountered 
"error"
{quote}
                
> error message only refers to "source" field when problem parsing value for 
> "dest" field of copyField
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-3657
>                 URL: https://issues.apache.org/jira/browse/SOLR-3657
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Hoss Man
>
> When a client submits a document with a value that is copyFielded into a 
> "dest" field where the value is not suitable (ie: something that is not a 
> number copied into a numeric field) the error message only refers to the 
> original "source" field name, not the "dest" field name.  ideally it should 
> mention both fields

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to