From 6658ccdda8defd5f64672d490cc901c5286f06df 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 | 77 ++++++++++--------- .../elasticsearch/elasticsearch.service.ts | 9 --- ...rganizations-from-metadata.service.spec.ts | 21 ++--- 3 files changed, 53 insertions(+), 54 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 28c8307a2..7f618f587 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'], + // }, + // }, }, }) }) @@ -210,11 +211,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }) }) @@ -269,11 +271,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }) }) @@ -310,11 +313,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'], + // }, + // }, }, }) }) @@ -363,11 +367,12 @@ describe('ElasticsearchService', () => { }, }, ], - must_not: { - terms: { - resourceType: ['service', 'map', 'map/static', 'mapDigital'], - }, - }, + // SPECIFIC GEOCAT + // must_not: { + // terms: { + // resourceType: ['service', 'map', 'map/static', 'mapDigital'], + // }, + // }, }, }) }) @@ -461,11 +466,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: { @@ -576,11 +582,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 e02d0c14e..291eaeca2 100644 --- a/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +++ b/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts @@ -304,7 +304,6 @@ export class ElasticsearchService { return { bool: { must, - must_not, should, filter, }, @@ -353,14 +352,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'] } }], },