Sitecore search facets may not be searchable when they contain the slash character


Description

When using the Search tab in the Content Editor and performing a search operation that uses search facets, unexpected results might be returned.

This happens if the selected facet value contains a forward slash ("/"), for example "Text/Value". In this case, only a part of the selected facet is searched, the "Text" part in this example.

For more information about facets, refer to the following article:
https://doc.sitecore.com/en/developers/102/sitecore-experience-manager/facets.html.

Solution

To fix the issue, please perform the following steps:

  1. Open the /sitecore/shell/Applications/Buckets/scripts/ItemBucket.js file.
  2. In the AppendFacet function, change the following block of code:
    var facetFilters = b.split(',');
    var filterValues = c.split('/');
    var titleValues = title.split('|');
    var o = new Array(); 
    to this one:
    var facetFilters = b.split(',');
    var filterValues = c.split('/');
    if (filterValues.length > 1) {
        var firstValue = filterValues[0];
        filterValues[0] = c;
        filterValues.push(firstValue);
    }
    var titleValues = title.split('|');
    var o = new Array();
  3. Clear the browser cache and restart the browser.