(modelName: string, page: number, size: number, body: any)
| 43 | } |
| 44 | |
| 45 | async search(modelName: string, page: number, size: number, body: any) { |
| 46 | const index = this.toIndex(modelName); |
| 47 | |
| 48 | LogService.debug(`\t🔄 ES.search(${index}) => ${JSON.stringify(body)}`); |
| 49 | return await this.client.search({ |
| 50 | index, |
| 51 | body, |
| 52 | from: (page - 1) * size, |
| 53 | size, |
| 54 | }); |
| 55 | } |
| 56 | |
| 57 | private toIndex(modelName: string): string { |
| 58 | const prefix = this.config.indexPrefix ? `${this.config.indexPrefix}-` : ""; |
no test coverage detected