Developer forum

Forum » PIM » Feed error when using Products.query

Feed error when using Products.query

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a feed (standard Rapido) and I want to use Product.query instead of [Channel] PartnersEurope.query.

With the PIM query, the feed renders products but as soon as I change it to the Products.query I get a nasty error:

<Error>

<Message>
An error has occurred.
</Message>
<ExceptionMessage>
An item with the same key has already been added.
</ExceptionMessage>
<ExceptionType>
System.ArgumentException
</ExceptionType>
<StackTrace>
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateView(IEnumerable`1 facetGroups, IDictionary`2 facetGroupResults, IDictionary`2 facetParameters, IEnumerable`1 queryParameters, Boolean showFacetOptionsWithNoResults) at Dynamicweb.Ecommerce.ProductCatalog.ViewModelFactory.CreateView(IEnumerable`1 facetGroups, IDictionary`2 facetGroupResults, IDictionary`2 facetParameters, IEnumerable`1 queryParameters, Boolean showFacetOptionsWithNoResults) at Dynamicweb.Ecommerce.Indexing.ProductQueryHelper.GetProductsAutoIdsFromIndexQuery(IQuery query, QuerySettings querySettings, PageView pageview, Boolean showFacetOptionsWithNoResults, IEnumerable`1&amp; facetViewModel, IEnumerable`1&amp; spellCheckerResult, Int32&amp; totalProductCount) at Dynamicweb.Ecommerce.Indexing.ProductQueryHelper.GetProductsAutoIds(ProductCatalogSettings settings, ContentModule contentModule, PageView pageview, IEnumerable`1&amp; facetViewModel, IEnumerable`1&amp; spellCheckerResult) at Dynamicweb.Ecommerce.Feeds.XMLProvider.GetOutput(Feed feed, FeedContextConfiguration feedContextConfiguration) at Dynamicweb.Ecommerce.WebAPI.Controllers.FeedController.GetFeedOutput(Int32 id, FeedContextConfiguration feedContextConfiguration) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.&lt;>c__DisplayClass10.&lt;GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.&lt;InvokeActionAsyncCore>d__0.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.&lt;ExecuteAsync>d__2.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.&lt;SendAsync>d__1.MoveNext()
</StackTrace>

</Error>

It seems to be related somehow with the Facets but even removing the facest would not solve the issue.

What am I doing wrong?

Thank you,
Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

It seems like a field mismatch issue. Maybe the same facet twice or something.

The product.query also uses macros and contexts that might not be working in the context of a feed.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have tried removing all facets and I got the same error.

Macros can be a good candidate for this error.

Thank you, I will explore this avenue.

Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Facets are not on the query it self but in a seperate file.

Maybe a field is twice in the query...?

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

The query works very well for listing products in the product catalog.

Only when I am trying to use it for a Channel Feed throws that error.

Adrian

 

You must be logged in to post in the forum