Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyvu committed Jan 17, 2025
1 parent e1fb35f commit 2472b32
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions lib/libs/opensearch-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,25 +181,12 @@ export async function getItem(
id: string,
): Promise<ItemResult | undefined> {
client = client || (await getClient(host));
console.log(client, "CLIENT???");
console.log(id, index, "ID AND INDEX???");
try {
console.log("CLIENT STUCK", await client.get({ id, index }));
const response = await client.get({ id, index });
console.log(response, "RESPONSE FROM OS");
const item = decodeUtf8(response).body;
console.log(item, "ITEM FROM OS");
if (item.found === false || !item._source) {
return undefined;
}
return item;
} catch (error) {
console.error("ERRRORORR", error);
if (error instanceof Error) {
console.error("ERR BODY:", error);
}
throw error;
const response = await client.get({ id, index });
const item = decodeUtf8(response).body;
if (item.found === false || !item._source) {
return undefined;
}
return item;
}

export async function getItems(ids: string[]): Promise<OSDocument[]> {
Expand Down

0 comments on commit 2472b32

Please sign in to comment.