SaaS CMS has officially launched! Learn more now.

Inventory and Lucene Search Provider


The default Lucene Search Provider does not seem add the inventory to the lucene search index (only PreOrder is added).

For our implementation it is required that we can filter and sort on warehouse inventory and total inventory. Using a Custom CatalogIndexer I am able to add custom fields to the search index, making this filtering and sorting possible. For each product I get the total inventory and each warehouse inventory and write these as separate fields in the Lucene Index.

The problem is this only works correctly when doing a full rebuild, but not on a normal build (only changed products are indexed).

Does anyone know a way to let the CatalogIndexer know what Inventory records have changed since the last build?

Some more information, our inventory is updated using a scheduled Task that is run every hour to update the stock from our backend software.

Jul 02, 2015 15:03


The default implementation of inventory system does not fire events when inventories are updated. You might need to create your own implementation based on that and fires events when you want.

But if you can wait then in next couple of weeks, we'll release a version of Commerce (possibly 8.15) which has the events for inventory AND price by default.



Edited, Jul 03, 2015 6:20


Thank you, I will certainly look at that when it is released. 

For now I am looking at using the SearchManager.Update(...) function, I will call this from within our Scheduled Job that updates the inventory. The issue with this at this moment is that only one Lucene 'writer' is allowed at any given time and sometimes our inventory job interferes with the other index jobs and one will fail. So I just have to make sure that this is handled correctly.

Jul 06, 2015 10:55


Stay tuned for Commerce 8.15, will be released in a couple of days. It will have new API:s to listen and fire events when prices and inventories are updated.

More information can be found here:



Jul 23, 2015 17:28
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.