sensenet icon indicating copy to clipboard operation
sensenet copied to clipboard

[Bug] indexing string resource values during import is incorrect

Open tusmester opened this issue 2 years ago • 0 comments

When a content is created early in the import process (e.g. all CTDs), before string resources under /Root/Localization are imported, all string resource fields (mainly DisplayName) are indexed incorrectly: an empty value is indexed. This is true for all regular content items too that are imported before string resources (e.g. under /Root/Content in snaas).

In case of DisplayName this affects sorting on the UI, which is a major issue.

Current empty index document for IMPORTED CTD display names

{
  "Name": "DisplayName",
  "Type": "StringArray",
  "Value": [""]
}

Correct value (created on the UI)

{
  "Name": "DisplayName",
  "Type": "StringArray",
  "Value": ["mytesttypeenglish","mytesttypegerman"]
}

This happens in LowerStringIndexHandler.GetIndexFields: the method SenseNetResourceManager.Current.GetStrings returns an empty string array, because there are no string resources yet.

Solution

  • We may have to memorize and reindex all content items that have fields containing string resources.
  • Import string resources immediately after CTDs and settings? We still have to reindex ctds, but that is acceptable.

tusmester avatar Jun 28 '22 09:06 tusmester