You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by "Michael Russo (JIRA)" <ji...@apache.org> on 2015/11/22 00:17:10 UTC

[jira] [Updated] (USERGRID-1126) Documents not getting index when JSON contains latitude or longitude fields with empty string values

     [ https://issues.apache.org/jira/browse/USERGRID-1126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Russo updated USERGRID-1126:
------------------------------------
    Description: 
Exception seen:

{code}
2015-11-21 21:40:37,249 [Usergrid-SQS-Pool-88] ERROR org.apache.usergrid.corepersistence.asyncevents.AmazonAsyncEventService- Failed to index message: 7435e8a3-9f4c-4a08-a833-307698c45cbd
java.lang.RuntimeException: Error during processing of bulk index operations one of the responses failed.
MapperParsingException[failed to parse]; nested: NumberFormatException[empty String];
{code}

Inside the entities, there are latitude and longitude fields which contain empty strings.  These are mapped in Usergrid/Elasticsearch as geo_point types which are expected to be numbers or non-empty strings.  This is causing the document to get rejected upon indexing.  

Needs to be fixed here to not add the lat and lon properties if the values are null or empty strings  (non empty strings index without a problem).
org/apache/usergrid/persistence/index/impl/EntityMappingParser.java:133

A temporary workaround is just to assign a number value for these fields, or just don't include them at all in the JSON request.

Current:
{code}
"geographicCoordinates": {
              "latitude": "",
              "longitude": ""
            }
{code}

Example workaround:
{code}
"geographicCoordinates": {
              "latitude": 1,
              "longitude": 1
            }
{code}

  was:
Exception seen:

{code}
2015-11-21 21:40:37,249 [Usergrid-SQS-Pool-88] ERROR org.apache.usergrid.corepersistence.asyncevents.AmazonAsyncEventService- Failed to index message: 7435e8a3-9f4c-4a08-a833-307698c45cbd
java.lang.RuntimeException: Error during processing of bulk index operations one of the responses failed.
MapperParsingException[failed to parse]; nested: NumberFormatException[empty String];
{code}

Inside the entities, there are latitude and longitude fields which contain empty strings.  These are mapped in Usergrid/Elasticsearch as geo_point types which are expected to be numbers.  This is causing the document to get rejected upon indexing.  

Needs to be fixed here to not add the lat and lon properties if the values are null or empty strings  (non empty strings index without a problem).
org/apache/usergrid/persistence/index/impl/EntityMappingParser.java:133

A temporary workaround is just to assign a number value for these fields, or just don't include them at all in the JSON request.

Current:
{code}
"geographicCoordinates": {
              "latitude": "",
              "longitude": ""
            }
{code}

Example workaround:
{code}
"geographicCoordinates": {
              "latitude": 1,
              "longitude": 1
            }
{code}


> Documents not getting index when JSON contains latitude or longitude fields with empty string values
> ----------------------------------------------------------------------------------------------------
>
>                 Key: USERGRID-1126
>                 URL: https://issues.apache.org/jira/browse/USERGRID-1126
>             Project: Usergrid
>          Issue Type: Bug
>            Reporter: Michael Russo
>            Assignee: Michael Russo
>
> Exception seen:
> {code}
> 2015-11-21 21:40:37,249 [Usergrid-SQS-Pool-88] ERROR org.apache.usergrid.corepersistence.asyncevents.AmazonAsyncEventService- Failed to index message: 7435e8a3-9f4c-4a08-a833-307698c45cbd
> java.lang.RuntimeException: Error during processing of bulk index operations one of the responses failed.
> MapperParsingException[failed to parse]; nested: NumberFormatException[empty String];
> {code}
> Inside the entities, there are latitude and longitude fields which contain empty strings.  These are mapped in Usergrid/Elasticsearch as geo_point types which are expected to be numbers or non-empty strings.  This is causing the document to get rejected upon indexing.  
> Needs to be fixed here to not add the lat and lon properties if the values are null or empty strings  (non empty strings index without a problem).
> org/apache/usergrid/persistence/index/impl/EntityMappingParser.java:133
> A temporary workaround is just to assign a number value for these fields, or just don't include them at all in the JSON request.
> Current:
> {code}
> "geographicCoordinates": {
>               "latitude": "",
>               "longitude": ""
>             }
> {code}
> Example workaround:
> {code}
> "geographicCoordinates": {
>               "latitude": 1,
>               "longitude": 1
>             }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)