Solr Cheat Sheat for Sitecore Commerce Catalog Items

In this article, we will look at some of the ways in which we can query Solr for commerce catalog items in the Sitecore Master and Web indexes, and the Commerce CatalogItemsScope index.

Catalog Documents

Master and Web Indexes

Query ByQuery String
Namecommercesearchitemtype_t:”Catalog” && name_t:”<name>
Display Namecommercesearchitemtype_t:”Catalog” && _displayname:”<display name>
Entity Idcatalogentityid_t:”Entity-Catalog-<catalog entity id>
Sitecore Idsitecoreid_t:”<Sitecore Id>
OR
_group:”<squashed Sitecore id>

Commerce CatalogItemsScope Index

Query ByQuery String
Nameentityid:Entity-Catalog-* && name:”<name>
Display Nameentityid:Entity-Catalog-* && displayname:”<display name>
Entity Identityid:”Entity-Catalog-<friendly id>”
OR
entityid:”<entity id>”
Sitecore Idsitecoreid:”<Sitecore Id>”

Category Documents

Master and Web Indexes

Query ByQuery String
Namecommercesearchitemtype_t:”Category” && _name:”<name>
Display Namecommercesearchitemtype_t:”Category” && _displayname:”<display name>
Entity Idcatalogentityid_t:”Entity-Category-<entity id>
Sitecore Idsitecoreid_t:”<Sitecore id>
OR
_group:”<squashed Sitecore id>

Commerce CatalogItemsScope Index

Query ByQuery String
Nameentityid:Entity-Category-* && name:”<name>
Display Nameentityid:Entity-Category-* && displayname:”<display name>
Entity Identityid:”Entity-Category-<friendly id>
OR
entityid:”<entity id>
Sitecore Idsitecoreid:”<Sitecore id>

Sellable Item Documents

Master and Web Indexes

Query ByQuery String
Namecommercesearchitemtype_t:”SellableItem” && _name:”<name>
Display Namecommercesearchitemtype_t:”SellableItem” && _displayname:”<display name>
Entity Idcatalogentityid_t:”Entity-SellableItem-<entity id>
OR
productid_t:”<entity id>
Sitecore Id_group:<Sitecore id>

Commerce CatalogItemsScope Index

Query ByQuery String
Nameentityid:Entity-SellableItem-* && name:<name>
Display Nameentityid:Entity-SellableItem-* && displayname:”<display name>
Entity Identityid:”Entity-SellableItem-<friendly id>
OR
entityid:”<entity id>
Variant Idvariantid:”<variant id>
Variant Display Namevariantdisplayname:*<variant display name>*
Sitecore Idsitecoreid:”<Sitecore id>