SDKits / ExamineX

Issue tracker for ExamineX
https://examinex.online
5 stars 0 forks source link

OnTransformingIndexValues does not persist transformed values. #65

Closed hallojoe closed 2 years ago

hallojoe commented 2 years ago

Umbraco 10.1.0, ExamineX 4.0

I have code that transform a blocklist into a string representation. It works with Umbraco Examine, but not ExamineX.

Breakpoint will hit my code and I see the tranformed value in transformedValues dictionary, but they do not persist after calling indexingItemEventArgs.SetValues(transformedValues);


    private void OnTransformingIndexValues(object? sender, IndexingItemEventArgs? indexingItemEventArgs)
    {
        // guard input
        if (indexingItemEventArgs == default) return;

        try
        {
            // return when content type is not included
            if (!_includedUmbracoDocumentTypeAliases.Contains(indexingItemEventArgs.ValueSet.ItemType)) return;

            //  transform value set
            var transformedValues = _indexValueTransform.Transform(indexingItemEventArgs.ValueSet);

            // set value set
            indexingItemEventArgs.SetValues(transformedValues);

        }
        catch (Exception ex)
        {
            _logger.LogError(ex.Message, ex);
        }
    }

Do you have any ideas why this is?

Because of a minor misunderstanding in backoffice, made me do some more things in order to resolve the issue.

I am running ExamineX 4.0, but in backoffice I see version 3.0.0 witch led me to believe that 3.0 was stuck somewhere. So I removed ExamineX packages from my local Nuget cache, and manually whiped all bin and obj folders in all solution projects. After doing so, backoffice still tells me I am running 3.0. I now see that the file version is 3.0 and product version is 4.0

image

Shazwazza commented 2 years ago

Hi, thanks for reporting. I believe this is due to a breaking change in the latest Examine and ExamineX hasn't been changed to deal with how this works. I'll get out a new release first thing next week.

Shazwazza commented 2 years ago

Hi, a beta 2 version has been published to Nuget with fixes for the version and OnTransformingIndexValues

hallojoe commented 2 years ago

Super. Will give it a go.