[
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 that can parse to
coordiantes. This is causing the document to get rejected upon indexing. See
the following for ensuring we are pre-validating so documents don't get
rejected:
https://www.elastic.co/guide/en/elasticsearch/reference/1.7/mapping-geo-point-type.html
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 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}
> 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 that can parse to
> coordiantes. This is causing the document to get rejected upon indexing.
> See the following for ensuring we are pre-validating so documents don't get
> rejected:
> https://www.elastic.co/guide/en/elasticsearch/reference/1.7/mapping-geo-point-type.html
> 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)