fix(ci): Update CI workflows and build config; bump dependencies; code style and TS config fixes
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Client as ElasticClient } from '@elastic/elasticsearch';
|
||||
|
||||
interface FastPushOptions {
|
||||
deleteOldData?: boolean; // Clear the index
|
||||
deleteIndex?: boolean; // Delete the entire index
|
||||
deleteOldData?: boolean; // Clear the index
|
||||
deleteIndex?: boolean; // Delete the entire index
|
||||
}
|
||||
|
||||
export class FastPush {
|
||||
@@ -15,7 +15,11 @@ export class FastPush {
|
||||
});
|
||||
}
|
||||
|
||||
async pushToIndex(indexName: string, docArray: any[], options?: FastPushOptions) {
|
||||
async pushToIndex(
|
||||
indexName: string,
|
||||
docArray: any[],
|
||||
options?: FastPushOptions,
|
||||
) {
|
||||
if (docArray.length === 0) return;
|
||||
|
||||
const indexExists = await this.client.indices.exists({ index: indexName });
|
||||
@@ -26,11 +30,9 @@ export class FastPush {
|
||||
} else if (options?.deleteOldData) {
|
||||
await this.client.deleteByQuery({
|
||||
index: indexName,
|
||||
body: {
|
||||
query: {
|
||||
match_all: {}
|
||||
}
|
||||
}
|
||||
query: {
|
||||
match_all: {},
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -39,11 +41,8 @@ export class FastPush {
|
||||
// Create index with mappings (for simplicity, we use dynamic mapping)
|
||||
await this.client.indices.create({
|
||||
index: indexName,
|
||||
body: {
|
||||
mappings: {
|
||||
dynamic: "true"
|
||||
// ... other specific mappings
|
||||
},
|
||||
mappings: {
|
||||
dynamic: 'true',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user