From 505f801de8d8f66ad4b91214ca7a484400638533 Mon Sep 17 00:00:00 2001 From: Florent Gravin Date: Tue, 11 Jun 2024 16:40:14 +0200 Subject: [PATCH] geocat: do not exclude services or maps in search --- .../elasticsearch.service.spec.ts | 88 ++++++++++--------- .../elasticsearch/elasticsearch.service.ts | 9 -- ...rganizations-from-metadata.service.spec.ts | 21 ++--- 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.spec.ts b/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.spec.ts index a63359d9e..154d0a120 100644 --- a/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.spec.ts +++ b/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.spec.ts @@ -155,11 +155,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }) }) @@ -223,11 +224,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }) }) @@ -289,11 +291,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }) }) @@ -348,11 +351,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }) }) @@ -389,11 +393,12 @@ describe('ElasticsearchService', () => { ], should: [], must: [], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }) }) @@ -442,11 +447,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }) }) @@ -540,11 +546,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, should: [ { geo_shape: { @@ -655,11 +662,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }, from: 0, diff --git a/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts b/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts index e658f2bbb..a27660285 100644 --- a/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +++ b/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts @@ -346,7 +346,6 @@ export class ElasticsearchService { return { bool: { must, - must_not, should, filter, }, @@ -395,14 +394,6 @@ export class ElasticsearchService { }, }, ], - must_not: { - ...this.queryFilterOnValues('resourceType', [ - 'service', - 'map', - 'map/static', - 'mapDigital', - ]), - }, }, }, _source: ['resourceTitleObject', 'uuid'], diff --git a/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.spec.ts b/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.spec.ts index ddb05655a..61e741eea 100644 --- a/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.spec.ts +++ b/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.spec.ts @@ -271,16 +271,17 @@ describe.each(['4.2.2-00', '4.2.3-xx', '4.2.5-xx'])( query: { bool: { must: [], - must_not: { - terms: { - resourceType: [ - 'service', - 'map', - 'map/static', - 'mapDigital', - ], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: [ + // 'service', + // 'map', + // 'map/static', + // 'mapDigital', + // ], + // }, + // }, should: [], filter: [{ terms: { isTemplate: ['n'] } }], },