diff --git a/src/AssociationRegistry.Admin.ProjectionHost/Projections/Search/ElasticRepository.cs b/src/AssociationRegistry.Admin.ProjectionHost/Projections/Search/ElasticRepository.cs index d5f730b84..ff4330b71 100644 --- a/src/AssociationRegistry.Admin.ProjectionHost/Projections/Search/ElasticRepository.cs +++ b/src/AssociationRegistry.Admin.ProjectionHost/Projections/Search/ElasticRepository.cs @@ -81,7 +81,9 @@ public async Task AppendLocatie(string id, ILocatie locatie) where T : class id, selector: u => u.Script( s => s - .Source("ctx._source.locaties.add(params.item)") + .Source("if(! ctx._source.locaties.contains(params.item)){" + + "ctx._source.locaties.add(params.item)" + + "}") .Params(objects => objects.Add(key: "item", locatie)))); if (!response.IsValid)