Developer forum

Forum » Ecommerce - Standard features » Partial Index - update vs. add row

Partial Index - update vs. add row

Skylar Kennedy
Reply

Hello,

As far as I understand, when a partial index runs once product data has been changed, it adds a new row to the Lucene index capturing this change, rather than updating the single row in the index. Due to this, when a customer makes a change to a product and runs the partial index, that product then gets duplicated on the frontend until the full index runs. The customer wants to use the partial index functionality but not if it duplicates products. Is there a way so that the partial index updates the index to capture the most recent edit to the product rather than adding a new row to the edit history each time? Any help is appreciated.


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Skylar

Welcome to the forums!

The index supports updates and full. If an update is performed, the actual document in the index is not updated, but deleted and a new one created. Lucene does not support updating an existing document.

The document being deleted and then re-created, is depending on a document key. When indexing products, that would be the ProductAutoID (AutoUpdateID field in the index document). So if the autoid changes for a given product, duplicates will happen - so when you operate with updates, make sure the AutoID does not change.

Also when searching the index, the lucene search returns these autoids and sends them to ProductService which will do the actual retrieaval from database. So even if the index did have 2 documents of the same product, they would return the same autoid - then passed to the ProductService which would retrieve the product only once. This would result in i.e. 9 products eventhough the paging says 10 products - but no duplicate product.

So my guess is that you need to check the database that you did not accidently created a second document.

Otherwise share some more of your setup so we can find out what is causing your duplicate product.

BR Nicolai

 
Skylar Kennedy
Reply

Hi Nicolai,

I appreciate the quick + detailed response - going to look into this a little bit more. Thanks again!

Skylar Kennedy

 

You must be logged in to post in the forum