0

When I search with any keyword I get results as well as I am able to see refiners also, which I can filter.

But when I search with some key word which doesn't have a matching result I get zero results with message Nothing here matches your search with a message We don't have any refiners to show you in the refinement panel area.

How to remove the error message We don't have any refiners to show you when the search keyword doesn't have any matching result in SharePoint 2013 Search Result.

Or either help me to change the message test.

1 Answer 1

1

You can try below methods:

  1. Put the below jquery code in the page.Make sure you have Jquery loaded.

$("[id$='csr4EmptyRefinement']").hide();

Or use the equivalent javascript to hide the div which shows the message.

  1. You can find out the control template used in the refinement panel and edit the template to hide the message. For eg: the default template used is Control_Refinement.html. Open site in SharePoint designer --> catalogs-->MasterPages-->Display Templates--> Filters--> Control_Refinement.html. Edit the file. The below section in the file displays the message. You can remove/comment out the section or change the text from there.
<div id="_#= ctx.ClientControl.get_emptyRefinementMessageId() =#_" class="ms-disabled ms-alignCenter ms-hide">
<!--#_
                    var emptyMessage = ctx.ClientControl.get_emptyMessage();
                    if ($isEmptyString(emptyMessage))
                    {
_#-->
                        _#= $htmlEncode(Srch.U.loadResource("rf_EmptyRefinement")) =#_
<!--#_
                    }
                    else
                    {
_#-->
                        _#= $htmlEncode(emptyMessage) =#_
<!--#_
                    }
_#-->
                </div>
1
  • 2
    May I suggest that you change a copy of the display template, not the original one 😊 Commented Mar 16, 2018 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.