Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: or-2073 rework facets to work with mapping #617

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading