(modelName: string)
| 13 | } |
| 14 | |
| 15 | async createIndex(modelName: string) { |
| 16 | const index = this.toIndex(modelName); |
| 17 | const result = await this.client.indices.exists({ index }); |
| 18 | if (result === false) { |
| 19 | await this.client.indices.create({ index }); |
| 20 | LogService.debug(`ES.create({ index: ${index} })`); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | async insert(modelName: string, id: string, body: any) { |
| 25 | const index = this.toIndex(modelName); |