0

Moongosastic を使用して、mongodb をエラスティック検索にマップしています。

ネストされたモデルがあります:

var officeSchema = new Schema({
    _id: Schema.ObjectId,
    name: String,
    location: {
        geo_point: {
            type: String,
            es_type: 'geo_point',
            es_lat_lon: true
        },
        lat: {type: Number},
        lon: {type: Number}
    }
});

var businessSchema = new Schema({
    _id: Schema.ObjectId,
    name: {type:String, es_indexed:true}
    office: {type:[officeSchema], es_indexed:true}
});

ただし、オフィス マッピング geo_point の結果は文字列です。

"office": {
      "properties": {
          "location": {
             "properties": {
                 "geo_point": {
                      "type": "string"
                  }
              }
          },

createMapping を実行する必要がありますか? createMapping はどのように見えるべきですか?

4

1 に答える 1