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:
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!
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?
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.
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:
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
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.
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.
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.
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=126.96.36.199, 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-188.8.131.52" newVersion="184.108.40.206" /> </dependentAssembly>
Now when I browse to http://XYZ.local/EPiServer/Find/#configure the error's gone :-)
<dependentAssembly> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-220.127.116.11" newVersion="18.104.22.168" /></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 :-)
Great! Thanks for sharing....