Skip to content

Commit fbff7f1

Browse files
committed
fix(search): add country and identifier list in route response
1 parent 73dd768 commit fbff7f1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/api/commons/queries/structures.elastic.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,17 @@ export default [
5151
brandName: { $ifNull: ['$currentName.brandName', null] },
5252
category: { $ifNull: ['$category.usualNameFr', null] },
5353
city: { $ifNull: ['$localisations.city', null] },
54+
country: { $ifNull: ['$localisations.country', null] },
5455
closureDate: { $ifNull: ['$closureDate', null] },
5556
creationDate: { $ifNull: ['$creationDate', null] },
5657
id: 1,
5758
identifiers: { $ifNull: ['$identifiers.value', null] },
59+
identifiantsLists: {
60+
$ifNull: [
61+
{ $map: { input: '$identifiers', as: 'id', in: { type: '$$id.type', value: '$$id.value' } } },
62+
null,
63+
],
64+
},
5865
isDeleted: { $ifNull: ['$isDeleted', false] },
5966
coordinates: { $ifNull: ['$currentLocalisation.geometry.coordinates', null] },
6067
locality: { $ifNull: ['$localisations.locality', null] },

src/api/search/search.routes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ const searchedFields = [
2727
'brandName',
2828
'category',
2929
'city',
30+
'country',
3031
'firstName',
3132
'id',
3233
'identifiers',
34+
'identifiersLists',
3335
'alternativePaysageIds',
3436
'lastName',
3537
'locality',

0 commit comments

Comments
 (0)