I’m trying to use the following OpenSearch TypeScript update, but I’m encountering issues when trying to reference _source in the response. I receive the error TS2339: Property '_source' does not exist on type 'UpdateByQueryResponse'.
async updateFieldByQuery<T>(index:string, id: string, body: T): Promise<ApiResponse<UpdateByQueryResponse | ResponseError>> {
return await this.openSearchConnector.client.update({
index,
id,
body: {
doc: body,
_source: true
}
});
}
How should I define the correct response type?