November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi Mark,
I am experiencing the same issue.
Where you able to sort it out?
Thanks!
Hi Mauro,
Yes, I did with the help of Episerver support. It turns out some packages where missing from my solution. The exception that you see here is a bit misleading. There was another exception:
TL/DR: some packages that where referenced where not loaded and this caused another exception.
Details:
ERROR EPiServer.Find.Commerce.FindCommerceInitializationModule: Could not apply catalog content conventions.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
This one is thrown when calling:
public override void ApplyConventions(IClientConventions clientConventions) { base.ApplyConventions(clientConventions); }
When decompiling Episerver we get this:
protected virtual void ApplyNestedConventions(NestedConventions nestedConventions) { nestedConventions.ForInstancesOf<IPricing>().Add<Price>((Expression<Func<IPricing,IEnumerable<Price>>>) (pricing => pricing.Prices())); nestedConventions.ForInstancesOf<IIndexedPrices>().Add<Price>((Expression<Func<IIndexedPrices,IEnumerable<Price>>>) (pricing => pricing.Prices())); nestedConventions.ForInstancesOf<IStockPlacement>().Add<Inventory>((Expression<Func<IStockPlacement,IEnumerable<Inventory>>>) (stockPlacement => stockPlacement.Inventories())); }
It turns out that this piece of code refenced some packages that where not found:
• Microsoft.Data.Edm 5.6.4
• Microsoft.Data.OData 5.6.4
• Microsoft.Data.Services.Client 5.6.4
• System.Spatial 5.6.4
After succesfully adding these packages it works. I have to add that we where in the process of updating to EPi 11 and this caused a dll hell where we had different versions of packages in our solution!
Hope this helps.
/Mark
Thanks Mark,
It weren't those assemblies the ones I had missing, but your answer pointed out where to look at.
I had this one missing:
Adding that NuGet package solved it.
Thanks again,
Mauro.
Hi,
I’m having difficulties getting a nested value into my Find index.:
I have a Commerce Variant with a property that exposes an IEnumerable
public IEnumerable AvailablePrices => this.Prices();
where this.Prices() is the default IPricingExtensions method. (I’ve also tried using Prices() directly but getting the same error)
In the conventions I have:().Add(x => x.AvailablePrices);
SearchClient.Instance.Conventions.NestedConventions.ForInstancesOf
This gets indexed fine:
"AvailablePrices": [
{
"CustomerPricing": {
"$type": "Mediachase.Commerce.Pricing.CustomerPricing, Mediachase.Commerce",
"___types": [
"Mediachase.Commerce.Pricing.CustomerPricing",
"System.Object",
"System.IEquatable`1[[Mediachase.Commerce.Pricing.CustomerPricing, Mediachase.Commerce, Version=10.8.0.0, Culture=neutral, PublicKeyToken=6e58b501b34abce3]]"
]
},
"___types": [
"EPiServer.Commerce.SpecializedProperties.Price",
"System.Object",
"System.ICloneable"
],
"ValidFrom$$date": "2013-12-05T23:00:00Z",
"$type": "EPiServer.Commerce.SpecializedProperties.Price, EPiServer.Business.Commerce",
"UnitPrice": {
"Amount$$number": 210,
Still, when querying I get:
nested: ElasticSearchIllegalArgumentException[mapping for explicit nested path is not mapped as nested: [AvailablePrices]];
this is called in:
query = query.OrderBy(v => v.AvailablePrices, p => p.UnitPrice.Amount, price =>
price.ValidFrom.LessThan(DateTime.Now)
& (price.ValidUntil.Exists() | price.ValidUntil.GreaterThan(DateTime.Now))
& (price.MarketId.Value.Match("BBNL")));
Episerver Find version: 12.5
Hope anyone can help!
/Mark