From 878c1e76643b423c7a5b94acc3393c9888325b67 Mon Sep 17 00:00:00 2001 From: Denis Capkovic Date: Sat, 23 Nov 2024 15:59:36 +0100 Subject: [PATCH] Fix `GET` request not working There was a bug in the url for GET request. Based on the [API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html) it should be `/_doc/<_id>`, but was `<_id>`. --- src/elastic-client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elastic-client.ts b/src/elastic-client.ts index 7bcf20e..fb77908 100644 --- a/src/elastic-client.ts +++ b/src/elastic-client.ts @@ -178,7 +178,7 @@ export class ElasticClient { } async get(params: GetRequest): Promise>> { - let url = `/${params.index}${params.id}` + let url = `/${params.index}/_doc/${params.id}` const queryParams = queryParametersGenerator( {