WebSphere Commerce 7 | Solr | Preprocess Command failed to run | Queries to find the Data Issues

You might have noticed Solr Preprocess might have failed because of the Data issues in the Master Catalog.

Here are the few queries to check the Data Issues in the Master Catalog and making the Solr Preprocess to fail,

Query 1:  Same Products/SKUs has been assigned to Multiple Catalog Groups in the Master Catalog,
select catentry_id, (select partnumber from catentry where catentry_id = c.catentry_id) partnumber,
        catgroup_id, (select identifier from catgroup where catgroup_id = c.catgroup_id) catgroup_identifier
from catgpenrel c
where catentry_id in
        (select catentry_id
        from catgpenrel
        where catalog_id = 10001
        group by catentry_id
        having count(catentry_id) > 1
        )


Query 2:  One Category is assigned with multiple Categories in the Master Catalog

select catentry_id, catgroup_id
from catgpenrel
where catentry_id in
    (select catentry_id from catgpenrel where catalog_id = 10001
        group by catentry_id having count(catentry_id) > 1
    )


Query 3:  One SKU assigned to multiple Parent Products in the Master Catalog
select child_catentry_id, count(catentry_id_parent) parents_count from (
select c1.partnumber as parent_partnumber, c1.catentry_id as catentry_id_parent,
c2.partnumber as child_partnumber, c2.catentry_id as child_catentry_id, cgr.catalog_id
from catentry c1, catentry c2, catentrel cr, catgpenrel cgr
where c1.catentry_id = cr.catentry_id_parent
and c2.catentry_id = cr.catentry_id_child
and cgr.catentry_id = c1.catentry_id
and cgr.catalog_id = 10001
and c1.markfordelete = 0
and c1.buyable = 1)
group by child_catentry_id
having count(catentry_id_parent) > 1


Query 4:  SKU (Item) assigned as Child to one Parent Product and also marked as Parent to another Child
select catentry_id, partnumber, c2.catentry_id_child as markedasparent
from catentry c1, catentrel c2
where c1.catentry_id = c2.catentry_id_parent
and catenttype_id = 'ItemBean'


Query 5:  Product assigned as Child to another Product
select catentry_id, partnumber, c2.catentry_id_parent as markedaschild
from catentry c1, catentrel c2
where c1.catentry_id = c2.catentry_id_child
and catenttype_id = 'ProductBean'

No comments:

Post a Comment

My Writings........

HCL Commerce v9.1 | Local Store Vs Remote Store

  Local Store Remote Store Project Type Migrated (Lift & Shift) - Newly Imp...