transporter icon indicating copy to clipboard operation
transporter copied to clipboard

long data type is converted to text data type giving "illegal_argument_exception" error

Open vioan opened this issue 8 years ago • 1 comments

I have a mongodb database with two collections. I wanted to move the database to elasticsearch. After I inserted the first collection, I tried the second one and I got a lot of errors like the one below:

ERRO[0017] _bulk failed list [320] error="&elastic.ErrorDetails{Type:"illegal_argument_exception", Reason:"mapper [value] of different type, current_type [long], merged_type [text]", ResourceType:"", ResourceId:"", Index:"", Phase:"", Grouped:false, CausedBy:map[string]interface {}(nil), RootCause:[]*elastic.ErrorDetails(nil), FailedShards:[]map[string]interface {}(nil)}" executionID=159 id=5a17f1587fb6321f5c577e91 index=enc-calc type=calc version=5 writer=elasticsearch

The mappings are different for each mongodb collection (there are no similar fields). I tried to ingest then in the same index but different type and the same error. As elasticsearch 6.0 doesn't allow anymore to have multiple type in the same index I decided to create an index for each mongodb collection. But even in this case I got the above error.

Right now my solution was to omit that "value" field (is for testing purpose), but my question is why transporter is trying to convert long to text when can just keep it as long in elaasticsearch as well.

vioan avatar Nov 29 '17 19:11 vioan

this usually indicates there's a mixed type field on the mongodb side as it doesn't really enforce a type restriction.

jipperinbham avatar Dec 12 '17 14:12 jipperinbham