SharePoint 2016 Search: Sorry, something went wrong – Control_QueryBuilderPreview.js error

Search REsults Preview Error

Background: Recently I was working on creation of search result sources which were supposed to be used in one of my site collection for search results. But as I typed the query and clicked Test Query button it threw following error on my screen.

Search REsults Preview Error
Figure 1 -Search Results Preview Error

Error: Search display templates are not present on this collection. To add them, you need to activate the “Search Server Web Parts and Templates” feature on the Site Collection Features page.

Correlation ID: 7eeb4b9f-4bda-e0b6-987c-03d72906086b

Display Error: The display template had an error. You can correct it by fixing the template or by changing the display template used in either the Web Part properties or Result Types.

Template ‘~sitecollection/_catalogs/masterpage/DisplayTemplates/System/Control_QueryBuilderPreview.js’ not found or has syntax errors. (LoadTemplate:)

Cause: Looking at the error from first four lines, it clearly says that Search display templates are not present on this site and “Search Server Web Parts and Template” feature need to be activated. By default this feature is not activated on newly installed sharepoint. And because of which  Control_QueryBuilderPreview.js does not exists.

Resolution:

Activating the “Search Server Webparts and Template” feature.

  1. SharePoint 2016 Management Shell as admin.
  2. Type the command and execute:

Re open “Build Your Query” page and everything should work perfectly!

References:

  1. https://sharepoint.stackexchange.com/questions/70452/query-builder-for-result-source-not-working-in-central-admin
  2. https://vladtalkstech.com/2014/11/search-display-templates-present-site-collection.html

Thanks for reading 

Keep reading, share your thoughts, experiences. Feel free  to contact us to discuss more. If you have any suggestion / feedback / doubt, you are most welcome.

Stay tuned on Knowledge-Junction.

3 thoughts on “SharePoint 2016 Search: Sorry, something went wrong – Control_QueryBuilderPreview.js error

  1. Hello, my name is Jorge Flores. I am from Peru and I have a question on the subject since the same thing happened to me. I don’t know if they can help me attached an image of the error.

    One or more of the following resource files could not be loaded:
    • / _catalogs / masterpage / display templates / language files / en-ES / home / mrd_customstrings.js? Ctag = 156 $$ 15.0.5249.1001
    • / _catalogs / masterpage / display templates / language files / en-ES / customstrings.js? Ctag = 156 $$ 15.0.5249.1001
    • / _catalogs / masterpage / display templates / language files / en-ES / mrd_events_customstrings.js? Ctag = 156 $$ 15.0.5249.1001
    Display error: An error has occurred in the display template. You can correct this by fixing the template or changing the display template used in the web part properties or result types.
    The template ‘~ sitecollection / _catalogs / masterpage / Display Templates / Content Web Parts / Group_Content.js’ is missing or has syntax errors. (LoadTemplate: ~ sitecollection / _catalogs / masterpage / Display Templates / Content Web Parts / Counselors / Control_List_AccesoConsejeros.js)

  2. Hi Jorge,

    From the first error: One or more of the following resource files could not be loaded…….., files mrd_customstrings.js, customstrings.js,mrd_events_customstring.js are not available at the given path, en-ES is the langauge pack for spanish langauge support. I think the language pack is not installed. You need to install Spanish language pack.

    From the second error: An error has occurred in the display template……, Group_Content.js is not available. Navigate to the path Site Settings->Master Page and Page Layouts->Display Templates->Content Web Parts->check whether the Group_Content.js is available. If not, Unpublish Group_Content.html file from the ribbon and the its supporting .js file will be created automatically, publish Group_Content.html again to major version.

This site uses Akismet to reduce spam. Learn how your comment data is processed.