November Happy Hour will be moved to Thursday December 5th.

Add records to the Commerce ApplicationLog

Vote:
 

Hi all

The Commerce search indexer uses the ApplicationLog when it does incremental updates. That seems to be working fine for us.

Now we have some product data that we keep in a custom database next to the Episerver Commerce database. We would like to be able to signal to the indexer that some of this information have been changed.

Is there any way that we can insert rows in the ApplicationLog table using some Commerce API method? I have access to both Code and Id of the catalog entries.

Regards

Anders

#172705
Dec 08, 2016 12:41
Vote:
 

Hi,

In case you have Code/Id of the entries, I think you can call the API:s to index directly

SearchManager.UpdateIndex(IEnumerable<int> itemIds) should do the trick.

Regards,

/Q

#172707
Edited, Dec 08, 2016 13:15
Vote:
 

Hi Quan

Thank you for your reply.

We have discussed this, but in some situations we may end up with a large number of products being updated, and we would like to have the index updated asynchrously for performance and concurrency issues. We would like to return as soon as possible from the method that identifies changes without having to wait for the index process being finished. We may also risk concurrent updates to products from our two sources different sources, so we would like that each update queues an event that a product needs to be indexed. Better to have two entries in the queue than having two data updates that only contain half the truth.

Basically we would like to have a queue of products that need to be reindexed, and as far as I can see, you kind of already have that queue in the ApplicationLog table :)

You also have a method of indexing changed products based on the ApplicationLog. All that is needed, is for me to be able to add a new entry to the "queue" :)

Regards

Anders

#172709
Dec 08, 2016 13:23
Vote:
 

If you really really want to update the ApplicationLog, you can look into LogAdmin class (and then LogDto dataset). However I still don't think it's a good way to go.

If your indexing processor is running (aka the indexing is done automatically without you having to run Build index manually), you might want to look at IChangeNotificationManager.  It'll queue things that will be processed by the indexing processor.

Regards,

/Q

#172711
Dec 08, 2016 13:43
* 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.