Skip to content

Commit

Permalink
feat: or-2073 rework facets to work with mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
QuintenGreenstack authored and koenmetsu committed Jan 26, 2024
1 parent 891743b commit 302ab98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ private static AggregationContainerDescriptor<VerenigingZoekDocument> Hoofdactiv
return aggregationContainerDescriptor.Terms(
WellknownFacets.HoofdactiviteitenCountAggregateName,
selector: valueCountAggregationDescriptor => valueCountAggregationDescriptor
.Field(document => document.HoofdactiviteitenVerenigingsloket.Select(h => h.Code))
.Field(document => document.HoofdactiviteitenVerenigingsloket.Select(
h => h.Code).Suffix("keyword")
)
.Size(size: 20)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ public static class VerenigingZoekDocumentMapping
public const string PubliekZoekenNormalizer = "publiek_zoeken_normalizer";
public const string PubliekZoekenAnalyzer = "publiek_zoeken_analyzer";


public static TypeMappingDescriptor<VerenigingZoekDocument> Get(TypeMappingDescriptor<VerenigingZoekDocument> map)
=> map.Properties(
descriptor => descriptor
.Keyword(
propertyDescriptor => propertyDescriptor
.Name(document => document.VCode)
.Name(document => document.VCode)
.Normalizer(PubliekZoekenNormalizer))
.Text(
propertyDescriptor => propertyDescriptor
Expand Down Expand Up @@ -104,7 +103,7 @@ public static IPromise<IProperties> Get(PropertiesDescriptor<VerenigingZoekDocum
.WithKeyword(PubliekZoekenNormalizer))
.Text(
propertyDescriptor => propertyDescriptor
.Name(document => document.Postcode)
.Name(document => document.Postcode)
.WithKeyword())
.Text(
propertyDescriptor => propertyDescriptor
Expand All @@ -117,10 +116,11 @@ private static class HoofdactiviteitMapping
{
public static IPromise<IProperties> Get(PropertiesDescriptor<VerenigingZoekDocument.HoofdactiviteitVerenigingsloket> map)
=> map
.Keyword(
.Text(
propertiesDescriptor => propertiesDescriptor
.Name(document => document.Code)
.WithKeyword(PubliekZoekenNormalizer))
.Name(document => document.Code)
.WithKeyword()
.Analyzer(PubliekZoekenAnalyzer))
.Text(
propertiesDescriptor => propertiesDescriptor
.Name(document => document.Naam)
Expand All @@ -134,7 +134,7 @@ public static IPromise<IProperties> Get(PropertiesDescriptor<VerenigingZoekDocum
=> map
.Keyword(
propertiesDescriptor => propertiesDescriptor
.Name(document => document.Code)
.Name(document => document.Code)
.Normalizer(PubliekZoekenNormalizer))
.Text(
propertiesDescriptor => propertiesDescriptor
Expand Down Expand Up @@ -165,7 +165,7 @@ public static IPromise<IProperties> Get(PropertiesDescriptor<VerenigingZoekDocum
=> map
.Keyword(
propertiesDescriptor => propertiesDescriptor
.Name(document => document.Bron)
.Name(document => document.Bron)
.Normalizer(PubliekZoekenNormalizer))
.Text(
propertiesDescriptor => propertiesDescriptor
Expand Down

0 comments on commit 302ab98

Please sign in to comment.