SaaS CMS has officially launched! Learn more now.

Search Facets not coming up


I am on Commerce Manager 7.5, using Lucene as search provider. I want to have facets returned by the search provider. I checked that the meta fields are included in the search index. I also matched the field names in the search.filters.config file but still no luck. What am I missing? 

I am using the code below 

 ICatalogSystem system = CatalogContext.Current;
            // Get catalog lists
            CatalogDto catalogs = system.GetCatalogDto();

            // Create Entry Criteria
            CatalogEntrySearchCriteria criteria = new CatalogEntrySearchCriteria();
            // Bind default catalogs if none found
            if (criteria.CatalogNames.Count == 0)
                if (catalogs.Catalog.Count > 0)
                    foreach (CatalogDto.CatalogRow row in catalogs.Catalog)
                        if (row.IsActive &&
                        row.StartDate <= frameworkcontext.current.currentdatetime && row.enddate>= FrameworkContext.Current.CurrentDateTime)
criteria.StartingRecord = 0;
            criteria.RecordsToRetrieve = 10;
criteria.Sort = new SearchSort("DisplayName");
            criteria.SearchPhrase = "blues";
            criteria.IgnoreFilterOnLanguage = true;
            // Perform search
            results = manager.Search(criteria);

            criteria.MarketId = _currentMarket.GetCurrentMarket().MarketId; 

CatalogEntryResponseGroup responseGroup = new CatalogEntryResponseGroup(CatalogEntryResponseGroup.ResponseGroup.CatalogEntryInfo);
if (criteria.CatalogNames.Count != 0)
                  Mediachase.Commerce.Catalog.Objects.Entries entriess = sfHelper.SearchEntries(criteria, out count, responseGroup, cacheResults, cacheTimeout);

            ISearchFacetGroup[] facets=     sfHelper.GetFacets(false, cacheTimeout);
                 // sfHelper.
                  dataSource = new CatalogIndexSearchDataSource();
                  dataSource.TotalResults = count;
                  dataSource.CatalogEntries = entriess;
Jul 10, 2014 21:13

Have you setup the Mediachase.Search.Filters.config file for your facets?



Jul 11, 2014 16:35

Yes I setup the Mediachase.Search.Filters.config in the front end project. Is that the right place or should it be in the commerce manager project? 

It looks like below 

                        Brand Test
                        Brand 3
                        Brand 4

Where SearchFacet1 and SearchFacet2 are the meta fields that I am trying to include. 

Jul 11, 2014 16:50

Can you please share the properties of SearchFacet1 Meta Field (Please Rebuild the Index also from commerce mananger after adding those facets in commerce manager also).


Edited, Jul 11, 2014 17:00

Name: SearchFacet1

Friendly Name: SearchFacet1

Type: Short String

Support Multiple Languages: Not checked 

Use in Comparison: checked

Allow Null Values: Checked

Use Encryption: Not Checked 

Allow Search: Checked 

Enable Sorting Search Results: Not Checked 

Include Values in Search Results: Not Checked 

Tokenize: Checked

Include in Default Search: Checked 

Jul 11, 2014 17:08

I rebuild the index from commerce manager but still no luck. I am getting the results as expected but not facetgroups.


Jul 11, 2014 17:22

Did you or anyone find a solution to this? I'm having the exact same problem, my SearchResult returns searchhits but the FacetGroup property is empty. I have added records to the configuration file and added the properties to the index.

Sep 04, 2014 16:37

Could you use this code

ISearchFacetGroup[] facets= sfHelper.SearchEntries(criteria).FacetGroups

instead of

ISearchFacetGroup[] facets= sfHelper.GetFacets(false, cacheTimeout)

In GetFacets, it seems that only call SearchEntries with default CreateSearchCriteria with searchquery.

Edited, Sep 05, 2014 6:31

No, same result unfortunately. I'm using Lucene. 

Sep 05, 2014 9:13

Emelie: Have you set the meta field to searchable? Look in commerce manager, for the meta field sepecified in the file. The meta field with the same name sould be set as searchable. This can also be done by code by adding the Searchable attribute to the property.

When this has been set, rerun the index with the "Full Search Index" job.

Sep 12, 2014 13:47

I have marked the meta fields as searchable and rebuilt the index but still no luck. 

Sep 12, 2014 17:07

public virtual string ISBN13 { get; set; }

fields with these two attributes makes it search able in CMS Editor mode (Catalog window)


Sep 12, 2014 17:17

public virtual string ISBN13 { get; set; }

fields with these two attributes makes it search able in CMS Editor mode (Catalog window)


Sep 12, 2014 17:17

Still having the same issue. I can see values for the Facet fields in Lucene index but facets are not being returned. I am using Luke to have a look at the luncene index. 

Dec 12, 2014 23:23

Syed: Can you create a support case on this, and send the code to the support team?

Dec 18, 2014 11:21

I think I found the solution.

The search criteria object I was creating using "new CatalogEntrySearchCriteria()" was always sending query without facets to lucene helper function. 

Switching to SearchFilterHelper factory class made it start working. 

SearchFilterHelper helper= new SearchFilterHelper();
// Create Entry Criteria
CatalogEntrySearchCriteria criteria = helper.CreateSearchCriteria("",new SearchSort(""));



Edited, Dec 22, 2014 23:15
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.