Tiger Eye
03/03/2025, 5:18 PMJemayn
03/03/2025, 7:14 PM$"fieldName_{cultureString.ToLowerInvariant()}"
. The culture is accessible from the currentpageTiger Eye
03/03/2025, 7:38 PMJemayn
03/03/2025, 7:52 PMTiger Eye
03/03/2025, 7:53 PMTiger Eye
03/03/2025, 7:55 PMJemayn
03/03/2025, 7:56 PMTiger Eye
03/03/2025, 8:00 PMJemayn
03/03/2025, 8:01 PMTiger Eye
03/03/2025, 8:01 PMTiger Eye
03/03/2025, 8:03 PMJemayn
03/03/2025, 8:04 PMJemayn
03/03/2025, 8:04 PMTiger Eye
03/03/2025, 8:05 PMJemayn
03/03/2025, 8:11 PMcsharp
nativeQuery = index.Searcher.CreateQuery().NativeQuery(rawQuery);
foreach (var productSearchFilter in filtersFromDb)
{
nativeQuery.WithFacets(x =>
x.FacetString(
IndexingHelper.GetIndexFieldName(
$"SearchFilter_{productSearchFilter.FilterAlias}_Value",
culture
),
c => c.MaxCount(200)
)
);
}
var searchResults = nativeQuery.Execute(
new QueryOptions(0, productRequest.PageSize * (productRequest.CurrentPage))
);
And then the searchResults contain the regular searchresults but also contain a list of facet results with a filtername and count value so its super easy to get facet results based on a standard search query