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

Try our conversational search powered by Generative AI!

How to include two properties with the same name in index?

Vote:
 

The custom Product model contains the following property:

public virtual String Markets { get; set; }

However, it conflicts with the EPiServer.Find.Commerce.EntryContentBaseExtensions.Markets() exception.

That results with the following error when indexing:

fail: EPiServer.Find.Cms.ContentIndexer[0]
      CPUNAME: An exception occurred while indexing content [Link 4__CatalogContent] [GUID fbe2fa15-9006-422e-8bbc-faf500a5de51] [Type StandardProduct] [Name D]: An item with the same key has already been added. Key: Markets
      System.ArgumentException: An item with the same key has already been added. Key: Markets

How to include both in the index?

#285301
Aug 10, 2022 14:36
Vote:
 

mmm I would never recommend naming properties that conflict with the internal properties...but if you have to...you could try changing the json property name ?

[JsonProperty(PropertyName = "StandardProduct.Markets")]

public virtual String Markets { get; set; }

#285341
Aug 10, 2022 23:47
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.