async function resetIndex () {
if (await client.indices.exists({ index })) {
await client.indices.delete({ index })
}

await client.indices.create({ index })
await putBookMapping()
}
/** Clear the index, recreate it, and add mappings */
Clear the index, recreate it, and add mappings
Clear the index recreate it and add mappings
async function resetIndex () {
if (await client.indices.exists({ index })) {
await client.indices.delete({ index })
}
await client.indices.create({ index })
await putBookMapping()
}
async function resetIndex ( ) { if ( await client . indices . exists ( { index } ) ) { await client . indices . delete ( { index } ) } await client . indices . create ( { index } ) await putBookMapping ( ) }
Clear the index, recreate it, and add mappings
Clear the index recreate it and add mappings