Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip fields from record while import #195

Closed
biow0lf opened this issue Jun 11, 2015 · 2 comments · Fixed by #778
Closed

Skip fields from record while import #195

biow0lf opened this issue Jun 11, 2015 · 2 comments · Fixed by #778

Comments

@biow0lf
Copy link
Contributor

biow0lf commented Jun 11, 2015

Is there exists any ability to skip adding field to final hash for ES while import?

I have problem with import:

[2015-06-11 18:26:15,914][DEBUG][action.bulk              ] [Speed Demon] [development_tours][4] failed to execute bulk item (index) index {[development_tours][point][686], source[{"_id":686,"tour_id":248,"title":"","description":"","location":{}}]}
org.elasticsearch.index.mapper.MapperParsingException: failed to parse
    at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:565)
    at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:493)
    at org.elasticsearch.index.shard.IndexShard.prepareIndex(IndexShard.java:480)
    at org.elasticsearch.action.bulk.TransportShardBulkAction.shardIndexOperation(TransportShardBulkAction.java:423)
    at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:149)
    at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:515)
    at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:422)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.elasticsearch.ElasticsearchParseException: field [lat] missing
    at org.elasticsearch.common.geo.GeoUtils.parseGeoPoint(GeoUtils.java:386)
    at org.elasticsearch.index.mapper.geo.GeoPointFieldMapper.parse(GeoPointFieldMapper.java:529)
    at org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:554)
    at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:487)
    at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:544)
    ... 9 more

When location hash is empty, ES raise org.elasticsearch.ElasticsearchParseException: field [lat] missing. Simple fix for this is not add location field. But how?

Simple script for reproduce:
https://gist.github.com/hkorte/9936192

@pyromaniac
Copy link
Contributor

This is a good point. Maybe it make sense to add ignore_nil and ignore_blank field options, but you have to create a patch for it. This is not supported currently.

@AlexVPopov AlexVPopov linked a pull request Apr 5, 2021 that will close this issue
7 tasks
@AlexVPopov
Copy link
Contributor

This is implemented in #778.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants