elasticsearch-river-mongodb icon indicating copy to clipboard operation
elasticsearch-river-mongodb copied to clipboard

Mongo dbref expansion

Open mcleae opened this issue 10 years ago • 4 comments

expand and nest dbrefs instead of mapping them as just the id and type

The following (where category is a dbref)

 {
      "_id" : "51a220fdb573df1144000000",
      "_source":{
          "body":"the body",
          "category":{"ref":"category","id":"5194272cfdea65e5d6000021"}
          }
      }
  }

Becomes

 {
      "_id" : "51a220fdb573df1144000000",
      "_source":{
          "body":"the body",
          "category":{
            "_id":"5194272cfdea65e5d6000021",
            "name":"arbitrary category for a thousand"
          }
      }
  }

mcleae avatar Apr 24 '15 00:04 mcleae

I'm not particularly excited about this feature. MongoDB recommends against using DBRefs

benmccann avatar Apr 24 '15 00:04 benmccann

the feature is already in this plugin, this just changes it to expand and nest the referenced doc. if dbrefs aren't used then this has no effect, if they are then it will at least result in a nested searchable document in elasticsearch, which is in line with mongo's recommendation of nesting the related data

mcleae avatar Apr 24 '15 00:04 mcleae

i just noticed this https://github.com/richardwilly98/elasticsearch-river-mongodb/issues/350. if the preference is to have a config for enabling/disabling fetching i can take care of that. i'll aim to leave it disabled by default so as to preserve the current functionality

mcleae avatar Apr 27 '15 14:04 mcleae

@benmccann configs for enabling/disabling are in, please let me know if you have any other concerns

mcleae avatar Apr 27 '15 15:04 mcleae