Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Commerce item URL incorrect from scheduled job

Vote:
 

Hi Everyone, 

I have an issue whereby I am indexing commerce items in Find via the scheduled job (EPiServer Find Content Indexing Job), but the URL I am indexing for these items is incorrect, and includes the language segment of the culture (EN) configured for the current sites host name - therefore when I render the results of the items in my search results they're wrong.

If I index the items myself, through a publish, the URL is correct (language segment is not in the URL). 

CMS based items are always right in terms of removing the language segment for EN, and applying language segment for other cultures. 

Can someone point me in the right direction of what I need to do to get this working?

It looks like it may an issue with getting the current site context via the job (this is a multi site solution).

Thanks,

Paul

#199145
Edited, Nov 16, 2018 14:02
Vote:
 

Anyone?

#199258
Nov 21, 2018 18:37
Vote:
 

Hi Paul,

If you go to the Overview (Epi Editmode) and look at a JSON result of a item that works correct and than you compare how it looks when you Index it with your custom job. What is the difference beside the URL?

I guess you do not use the default Epi Find index job due to that you have to do some custom stuff?

#199433
Nov 27, 2018 15:56
Vote:
 

Hi Radek, 

No I do use the default Epi Find indexing job yes.

If I look at the JSON indexed for the product in Find, the value of "SearchHitUrl$$string" contains "/en/catalog...." but the problem is as my host for my site is configured with EN as its default language, clicking on a URL beginning with "/en/...." will result in a 404. 

When I simply publish the product myself via the catalog, the value of "SearchHitUrl$$string" is correct and starts with "/catalog".

So what I have to do currently to fix this is after I get a unified search result back, I get the original object of the result "hit.OriginalObjectGetter.Invoke()" and then get the correct friendly URL of the page.

It seems there must be a better way however!

Thanks again,

Paul

#199588
Dec 03, 2018 10:37
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.