Try our conversational search powered by Generative AI!
AI OnAI Off
So, I was able to figure this out. I ended up having to reindex all of the content for the variant URL to start getting assigned to the Unified search hit. I did still have to do a little bit of tweaking. In my init module, I still had to add my variants to the Unified search registry like I posted above.
Initially, the URL that was getting set for each was throwing a 404. For some reason, Find was appending /en at the beginning. Since I had 'en' set as the default culture of the website in the cms admin, I am not sure why Commerce wasn't picking it up. So, what I ended up doing for a solution to this was implementing SearchHitUrl, which is part of ISearchContent, on my product variation classes.
public virtual string SearchHitUrl { get { return SeoUri; } }
Everything is now working as expected.
Hello,
I have been having an issue with Unified Search results for Commerce product variations that get returned. I have tried several ways to project the url to the results with little success. The only time I did get it to work was using the depricated UnifiedSearchRegistry.CustomizeProjection. That broke when I upgraded to the latest version of Find. Seems weird to me that Commerce content is not fully supported by default in the latest version of Find. Perhaps I am missing something? To even get the indexed variants to show in Unified Search results, I have to manually add them to the UnifiedSearchRegistry via an InitializableModule.
Here is how I am trying to project the URL in my InitializableModule:
The GetUrl() is a custom extension method. Here is how I am looping through the results and assigning the URL:
The url on the variantion results is always empty. Any help on with this would be grately appreciated. Here are the versions I am using with everything:
Thanks in advance!