0

NodeJs 用の mongoosastic プラグインを使用して、既存のコレクションを ElasticSearch にインデックス付けしようとしています。これは私のスキーマです:

const callCenterSchema = new mongoose.Schema({
    _owner : { type: mongoose.Schema.Types.ObjectId, ref: 'User', es_type: 'object' },
    ivrs: [{
        name: {
            type: String,
            es_type: 'string'
        },
        ivrType: {
            type: String,
            default: 'mobile',
            enum: ['mobile', 'website'],
            es_type: 'string'
        },
        submenu: {
            type: [ CallCenterSubmenu.schema ],
            es_type: 'nested',
            es_include_in_parent: true
        }
    }]
});

callCenterSchema.plugin(mongoosastic, {
    esClient: require('tusla/lib/db/elastic').elastic,
    populate: [
        { path: '_owner' }
    ]
});

let CallCenter = mongoose.model('CallCenter', callCenterSchema);
CallCenter.synchronize()

CallCenter.createMapping(function(err, mapping) {
  if (err) {
    console.error('Error creating mapping for CallCenters', err.message);
  }
});


module.exports = CallCenter;

私のサブメニュースキーマは次のようなものです:

const callcenterSubmenuSchema = new mongoose.Schema({
    name: String,
    key: String,
    waitTime: {
        type: Number
    },
    waitSuffix: String,
    numberOrLink: String,
    auth: {
        canBeSkipped: String,
        fields: {
            type: Array,
            es_type: 'object'
        },
        verification: String,
        regExp: String
    },
    submenu: [this]
}, { _id: false });

この特定のエラーが発生し続けますが、解決できませんでした。皆さんが私を助けていただければ幸いです。

ありがとう!

コールセンターのマッピング作成エラー [mapper_parsing_exception] タイプ [mixed] のハンドラーがフィールド [サブメニュー] で宣言されていません

4

1 に答える 1