Friday, January 9, 2015

WebSphere Commerce Inventory Indexing Notes

Notes:

The di-proprocess script will do nothing for a full index build, if you check the wc-dataimport-preprocess-fullbuild.xml, the sql="".

In di-buildindex process, the inventory data is retrieved from INVENTORY table directly:

in the wc-data-config.xml file under the ...\IBM\WCDE_ENT70\search\solr\home\MC_10001\generic\CatalogEntry\Inventory\conf\wc-data-config.xml

for ItemBean:

SELECT 
    INVENTORY.CATENTRY_ID, 
    INVENTORY.STORE_ID, 
    INVENTORY.FFMCENTER_ID, 
    INVENTORY.QUANTITY
FROM INVENTORY
WHERE INVENTORY.QUANTITYMEASURE = 'C62' -- This is an ISO standard UOM: 1
AND INVENTORY.CATENTRY_ID IN (
    SELECT CATENTRY.CATENTRY_ID
    FROM CATENTRY, CATGPENREL
    WHERE CATGPENREL.CATALOG_ID = 10001
    AND CATENTRY.MARKFORDELETE = 0
    AND CATENTRY.CATENTRY_ID = CATGPENREL.CATENTRY_ID
    AND CATENTRY.CATENTTYPE_ID = 'ItemBean')
ORDER BY INVENTORY.CATENTRY_ID, INVENTORY.STORE_ID, INVENTORY.FFMCENTER_ID

for ProductBean:

SELECT 
    CATENTREL.CATENTRY_ID_
    PARENT CATENTRY_ID, 
    INVENTORY.STORE_ID, 
    INVENTORY.FFMCENTER_ID, 
    SUM(INVENTORY.QUANTITY) TOTAL_QUANTITY
FROM INVENTORY, CATENTRY, CATENTREL, CATGPENREL
WHERE CATGPENREL.CATALOG_ID = 10001
AND CATENTRY.CATENTRY_ID = CATGPENREL.CATENTRY_ID
AND CATENTRY.CATENTRY_ID = CATENTREL.CATENTRY_ID_CHILD
AND INVENTORY.QUANTITYMEASURE = 'C62'
AND CATENTRY.CATENTTYPE_ID = 'ItemBean'
AND CATENTREL.CATENTRY_ID_CHILD = INVENTORY.CATENTRY_ID
GROUP BY CATENTREL.CATENTRY_ID_PARENT, INVENTORY.STORE_ID, INVENTORY.FFMCENTER_ID
ORDER BY CATENTREL.CATENTRY_ID_PARENT, INVENTORY.STORE_ID, INVENTORY.FFMCENTER_ID

No comments:

Post a Comment