Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change aoe-web-backend opensearch refresh=wait_for to false #28

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aoe-web-backend/src/search/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export async function metadataToEs(offset: number, limit: number) {
const body = data.flatMap(doc => [{ index: { _index: index, _id: doc.id } }, doc]);
// winstonLogger.debug("THIS IS BODY:");
// winstonLogger.debug(JSON.stringify(body));
MikkoKauhanen marked this conversation as resolved.
Show resolved Hide resolved
const { body: bulkResponse } = await client.bulk({ refresh: true, body });
const { body: bulkResponse } = await client.bulk({ refresh: false, body });
if (bulkResponse.errors) {
const erroredDocuments = [];
// The items array has the same order of the dataset we just indexed.
Expand Down Expand Up @@ -454,7 +454,7 @@ export const updateEsDocument = (updateCounters?: boolean): Promise<any> => {
.then(async (data: any) => { // #1 then start
if (data.length > 0) {
const body = data.flatMap(doc => [{ index: { _index: index, _id: doc.id } }, doc]);
const { body: bulkResponse } = await client.bulk({ refresh: true, body });
const { body: bulkResponse } = await client.bulk({ refresh: false, body });
if (bulkResponse.errors) {
winstonLogger.error('Bulk response error: %o', bulkResponse.errors);
} else {
Expand Down
2 changes: 1 addition & 1 deletion aoe-web-backend/src/search/esCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export async function collectionDataToEs(index: string, data: any) {
const body = data.flatMap(doc => [{ index: { _index: index, _id: doc.id } }, doc]);
// winstonLogger.debug("THIS IS BODY:");
// winstonLogger.debug(JSON.stringify(body));
MikkoKauhanen marked this conversation as resolved.
Show resolved Hide resolved
const { body: bulkResponse } = await client.bulk({ refresh: true, body });
const { body: bulkResponse } = await client.bulk({ refresh: false, body });
if (bulkResponse.errors) {
const erroredDocuments = [];
// The items array has the same order of the dataset we just indexed.
Expand Down
Loading