Skip to content

Commit

Permalink
Merge pull request #234 from sachatrauwaen/feature/233-duplicate-sear…
Browse files Browse the repository at this point in the history
…ch-results

Fixes #233
  • Loading branch information
skamphuis authored May 15, 2024
2 parents 202fe8d + 50063a4 commit dca3dfd
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions OpenContent/Components/FeatureController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,9 @@ public override IList<SearchDocument> GetModifiedSearchDocuments(ModuleInfo modI

if (DnnLanguageUtils.IsMultiLingualPortal(modInfo.PortalID))
{
if (string.IsNullOrEmpty(modInfo.CultureCode))
{
// it's a neutral language module according to DNN, which means we will need to add the neutral language content too
var culture = ps.DefaultLanguage;
var localizedData = GetLocalizedContent(content.Data, culture, modInfo);
// pass "" as culture to indicate we're indexing the neutral language here
searchDoc = CreateSearchDocument(ps, modInfo, module.Settings, localizedData, content.Id, "", content.Title, content.LastModifiedOnDate.ToUniversalTime());
searchDocuments.Add(searchDoc);
App.Services.Logger.Trace($"Indexing content {modInfo.ModuleID}|{culture} - OK! {searchDoc.Title} ({modInfo.TabID}) of {content.LastModifiedOnDate.ToUniversalTime()}");
}
// now start creating the docs for specific cultures
// start creating the docs for specific cultures
// we don't add a search docuement with the neutral language anymore,
// because that results in duplicate documents in search results
foreach (var portalLocale in portalLocales.Keys)
{
var localizedData = GetLocalizedContent(content.Data, portalLocale, modInfo);
Expand Down

0 comments on commit dca3dfd

Please sign in to comment.