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

Try our conversational search powered by Generative AI!

Script errors for SearchWithWeights and BestBets

Vote:
 

Hi!

I'm trying to implement best-bets but when I try to add one there's a script error:

Unable to load /EPiServer/Find/api/editorialboosting/searchwithweights/ status: 500

After examining the script console there also seems to be an error related to searching with weights:

Unable to load /EPiServer/Find/api/editorialboosting/searchwithweights/ status: 500

Has anyone else experienced this, and if so did you manage to resolve the issue?

We're running EPiServer CMS 10.10.4.0 & EPiServer Find CMS 12.6.2. I guess one alternative would be to upgrade both the CMS and Find.

Thank you in advance!

#196076
Aug 17, 2018 13:46
Vote:
 

Can you give us more information to reproduce the issue:

Which target content you're using for BestBet? CMS content, Commerce content or external link?

And which UI you got the issue?

/Son Do

#196168
Edited, Aug 21, 2018 10:44
Vote:
 

Do you have any custom Json serializer formatters specified? That may interfere with the Best Bets and boosting UI in the admin. Commenting it out in your code will resolve the issue.

#196197
Aug 22, 2018 4:18
Vote:
 

Our target content is mostly CMS content but we also have a couple of scheduled jobs that index content pulled from outside the CMS.

When we go to this URL https://xyz.local/EPiServer/Find/#configure we get the following error:

Unable to load /EPiServer/Find/api/editorialboosting/searchwithweights/ status: 500

When we go to https://xyz.local/EPiServer/Find/#manage/optimization/bestbets?phrases=test and try to create a BestBet we get the following error:

Unable to load /EPiServer/Find/api/bestbets/ status: 500

#196256
Aug 23, 2018 9:59
Vote:
 

I found the following in our code:

private static void ConfigCamelCase()
{
	var formatters = GlobalConfiguration.Configuration.Formatters;
	var jsonFormatter = formatters.JsonFormatter;
	var settings = jsonFormatter.SerializerSettings;
	settings.Formatting = Formatting.Indented;
	settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
}

However, when I commented it and ensured it wasn't run the problem didn't go away.

#196257
Aug 23, 2018 10:04
Vote:
 

The code may have already initialized. Try commenting out the code, publish and IIS reset/App pool recycle to make sure it forces all initialization steps again.

Aniket

#196263
Aug 23, 2018 13:25
Vote:
 

I've tried commenting out the code, recycled the app pool and restarted the site but the error is still there.

In my log file there are errors related to EPiServer Search but it would be ironic if that affected functions in EPiServer Find. Would be nice to know if there was some way to turn on logging for EPiServer Find. 

#196317
Aug 24, 2018 14:59
Vote:
 

I managed to dig up some more information regarding the exception:

"System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies."

This led me to adding the following in web.config:

<dependentAssembly>
    <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.5.0" newVersion="5.2.5.0" />
</dependentAssembly>

Now when I browse to http://XYZ.local/EPiServer/Find/#configure the error's gone :-)

#196390
Aug 29, 2018 10:03
Vote:
 

I managed to dig up some more information regarding the exception:

"System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies."

This led me to adding the following in web.config:

<dependentAssembly>
    <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.5.0" newVersion="5.2.5.0" />
</dependentAssembly>

The above - in combination with removing a custom formatter - seemed to do the trick. Now when I browse to http://XYZ.local/EPiServer/Find/#configure the error's gone :-)

#196399
Aug 29, 2018 14:41
Vote:
 

Great! Thanks for sharing....

#196438
Aug 30, 2018 18:45
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.