From fdb75bd2243c7c5dbe10c216bafd62cac2e388cb Mon Sep 17 00:00:00 2001 From: Alex Graf Date: Tue, 9 Apr 2024 14:03:24 +0200 Subject: [PATCH] fix lint --- .../app/scripts/export-to-elasticsearch.ts | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/apps/server-asset-sg/src/app/scripts/export-to-elasticsearch.ts b/apps/server-asset-sg/src/app/scripts/export-to-elasticsearch.ts index ecce5bdb..095b3b0f 100644 --- a/apps/server-asset-sg/src/app/scripts/export-to-elasticsearch.ts +++ b/apps/server-asset-sg/src/app/scripts/export-to-elasticsearch.ts @@ -11,7 +11,6 @@ import { Eq as EqString } from 'fp-ts/string'; import * as D from 'io-ts/Decoder'; import * as G from 'io-ts/Guard'; import { Overwrite } from 'type-zoo'; -import * as dotenv from 'dotenv'; import { isNotNil } from '../../../../../libs/core/src/'; import { ElasticSearchAsset } from '../../../../../libs/shared/src/'; @@ -27,28 +26,8 @@ export const date: D.Decoder = D.fromGuard(dateGuard, 'Date'); export const dateIdFromDate = (d: Date) => (d.getFullYear() * 10000 + (d.getMonth() + 1) * 100 + d.getDate()) as DateId; export const DateIdFromDate = pipe(date, D.map(dateIdFromDate)); -dotenv.config(); - const index = 'swissgeol_asset_asset'; -const mappingProperties = { - assetId: { type: 'integer' }, - properties: { - assetId: {type: "integer" }, - assetKindItemCode: { type: "keyword" }, - authorIds: { type: "integer" }, - contactNames: { type: "text",fields: {keyword: {type: "keyword",ignore_above: 256}}}, - createDate: { type: "long" }, - createDateId: { type: "integer" }, - languageItemCode: { type: "keyword" }, - manCatLabelItemCodes: { type: "keyword" }, - sgsId: { type: "keyword" }, - titleOriginal: { type: "text", fields: { keyword: { type: "keyword", ignore_above: 256 }} }, - titlePublic: {type: "text",fields: {keyword: {type: "keyword",ignore_above: 256}}}, - usageCode: { type: "keyword" } - } - }; - const main = async () => { try { const options = { @@ -68,15 +47,6 @@ const main = async () => { console.log('connected'); - - const exists = await client.indices.exists({ index }); - if (!exists) { - /* await client.indices.create({ - index, - mappings: mappingProperties - });*/ - } - const prisma = new PrismaClient(); const RawAsset = D.struct({