elasticsearch-river-mongodb
elasticsearch-river-mongodb copied to clipboard
mongodb.options.import_all_collections forces index.type value to source collection name
Hi,
Everything is in the title. For commodity sake and for home-made sharding purpose, my source database provides many collections that are push to ElasticSearch with a _type equal to my source collection. My frontend elasticsearch (elastica) client requires me to declare ALL types, that is a NO GO.
Could it be possible to change current behavior and honor index.type configuration value if present ? Keeping actual behavior if index.type is left blank ?
Thanks for this very nice tool, it help me a lot.
private Timestamp<?> processBlockingQueue(QueueEntry entry) {
// snip
String type;
if (definition.isImportAllCollections()) {
type = entry.getCollection();
} else {
type = definition.getTypeName();
}
The field is never left null or empty, and forced to mongodb.db if missing.
I'd suggest a new boolean field to change this behavior. I'll try to submit a pull-request if my java skills allow that.