You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Andrzej Bialecki (JIRA)" <ji...@apache.org> on 2019/03/07 15:56:00 UTC

[jira] [Commented] (SOLR-13304) PreanalyzedField#createField swallows Exception

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

Andrzej Bialecki  commented on SOLR-13304:
------------------------------------------

+1. I would also add the field name in the exception's message to help with troubleshooting.

> PreanalyzedField#createField swallows Exception
> -----------------------------------------------
>
>                 Key: SOLR-13304
>                 URL: https://issues.apache.org/jira/browse/SOLR-13304
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 8.0, 7.7.1
>            Reporter: Gus Heck
>            Assignee: Gus Heck
>            Priority: Major
>         Attachments: SOLR-13304.patch
>
>
> The following code allows one to believe that an ill formatted pre-analyzed field has successfully been written unless one is actively monitoring the logs: 
> {code}@Override
> public IndexableField createField(SchemaField field, Object value) {
>   IndexableField f = null;
>   try {
>     f = fromString(field, String.valueOf(value));
>   } catch (Exception e) {
>     log.warn("Error parsing pre-analyzed field '" + field.getName() + "'", e);
>     return null;
>   }
>   return f;
> }{code}
> I believe this should throw an error just like a poorly formatted date or other invalid value.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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