packages/easysearch_elasticsearch/lib/engine.js
/**
   * Act on index creation.
   *
   * @param {Object} indexConfig Index configuration
   */
Act on index creation.
@param {Object} indexConfig Index configuration
Act on index creation . @param { Object } indexConfig Index configuration
onIndexCreate(indexConfig) {
    super.onIndexCreate(indexConfig);
    if (Meteor.isServer) {
      indexConfig.elasticSearchClient = new elasticsearch.Client(this.config.client);
      indexConfig.elasticSearchSyncer = new ElasticSearchDataSyncer({
        indexName: 'easysearch',
        indexType: indexConfig.name,
        collection: indexConfig.collection,
        client: indexConfig.elasticSearchClient,
        beforeIndex: (doc) => this.callConfigMethod('getElasticSearchDoc', doc, this.callConfigMethod('fieldsToIndex', indexConfig))
      });
    }
  }
onIndexCreate ( indexConfig ) { super . onIndexCreate ( indexConfig ) ; if ( Meteor . isServer ) { indexConfig . elasticSearchClient = new elasticsearch . Client ( this . config . client ) ; indexConfig . elasticSearchSyncer = new ElasticSearchDataSyncer ( { indexName : 'easysearch' , indexType : indexConfig . name , collection : indexConfig . collection , client : indexConfig . elasticSearchClient , beforeIndex : ( doc ) => this . callConfigMethod ( 'getElasticSearchDoc' , doc , this . callConfigMethod ( 'fieldsToIndex' , indexConfig ) ) } ) ; } }
Act on index creation.
Act on index creation .