Search returning products only.

I have search functionality to return products based on a user's search parameter. The results are returning products and variants, but I only want the products returned. I thought that setting the CatalogClassType as ProductClass would filter out the variants but it doesn't seem to be working. Can somebody point me in the right direction? Thank you.

CatalogSearchOptions searchOptions =newCatalogSearchOptions();

searchOptions.PropertiesToReturn ="CatalogName, ProductId, DisplayName";

searchOptions.ClassTypes =CatalogClassTypes.ProductClass;

CatalogSearch catalogSearch =CommerceContext.Current.CatalogSystem.GetCatalogSearch();

catalogSearch.CatalogNames ="Default";

catalogSearch.SqlWhereClause =string.Format("DisplayName LIKE '%{0}%'", searchParameter);

[1535 byte] By [HR_2007] at [2008-1-8]
# 1

Can you try the same search including "i_ClassType = 4" in the SqlWhereClause?

Thanks

Sudha

SudhaRaghavan-MSFT at 2007-10-2 > top of Msdn Tech,Commerce Server,Commerce Server 2007...
# 2

Thanks for your reply Sudha but it didn't work. If I open up the CatalogItemsDataSet the products have a i_ClassType of 8 and the variants have an i_ClassType of 2. I tried adding i_ClassType = 8, as well as i_ClassType <> 2, but neither of these worked either. Could there be a problem with the way the catalog was setup?

Thanks again for your help.

HR_2007 at 2007-10-2 > top of Msdn Tech,Commerce Server,Commerce Server 2007...