change "No results are available. Either no query is specified, or the query came from advanced search (Federated Webparts do not support Advanced Search queries). "

Hello all,

Is there a way to change the No results message in the search core results webpart with xslt.

Thanks for the help.

Best Regards,

André

May 20th, 2011 5:00pm

All of the content, including the No results are available." message can be customized in the xsl within the Core Results web part.
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2011 3:04am

Mike, have you tried to modify exqctly this part of the xsl yourself? Because, when I tried I had no success with modifying the dvt_1.noKeyword template, while for instance modifying the dvt_1.empty template is not a problem. You can even remove the call for the template from the main template (match="/"), and it has no effect. I am wondering if this is a message that is output from somewhere else than the XSL, and it would be great if someone confirmed whether this is the case or not. There's another post in a Sharepoint 2010 forum that explains how you can remove this message by using jquery to remove the node that is output, and apparently that was a successful hack. However, it _should_ be possible to do it in the xsl. I haven't been able to make it work, though.

edit: link to the post I mentioned above: http://social.technet.microsoft.com/Forums/en-US/sharepoint2010general/thread/08bec7c2-c7da-41cd-a718-3fd754ceeb4a 

May 31st, 2011 6:10pm

Agreed, I've tried exactly what Mike described in SP2010, and the message won't go away.
Free Windows Admin Tool Kit Click here and download it now
November 4th, 2011 3:28pm

I don't think that this is the correct answer, in fact I think this is the intended functionality but I'm quite sure that if you try this you'll see that it doesn't work.

December 10th, 2011 4:17pm

Mike, did you propose this answer yourself? I feel that if something is going to be marked as an answer it should at least be accurate. Better still, it should contain some useful instruction on how to resolve the problem.

I wasted hours of life on this problem, expecting that I was clearly doing something stupid. Because surely there's NO WAY this message is acceptable for public-facing web sites.

My final solution - and by far the simplest - was to simply override the srch-wperror CSS class.

.srch-wperror {display:none !important}

Free Windows Admin Tool Kit Click here and download it now
December 16th, 2011 2:36am

Mike,

This message shows up on the screen even when you remove ALL xsl transformation and simply echo the XML back as below.

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
	<xsl:template match="/">
		<xmp>
			<xsl:copy-of select="*" />
		</xmp>
	</xsl:template>
</xsl:stylesheet>

Therefore this message is not contained ANYWHERE in the XSL. This is not the answer.
May 22nd, 2012 9:42pm

Hi,

this message comes from resource file embedded into assembly

microsoft.office.server.search.intl.dll



and for Core Results web part this message renders when Query Error occurs instead of displaying actual search result, this is why for this message XSLT customization could not be applied as for regular search results.

But it could be customized on the client side, for example the script below (jQuery is used here) changes this message:

$(function()    

{        

var srchErrorLabel = $('.srch-wperror').find('span');       
srchErrorLabel.text('Place user friendly message here');    

})


So, if you add on page where Core Results web part is located this script, the message

Place user friendly message here

will be displayed.

Hope this helps,
Vadim

Free Windows Admin Tool Kit Click here and download it now
December 7th, 2012 10:53am

Hi ,

You can do it using javascript function.

$(function() 
   { 
       var srchErrorLabel = $('.srch-wperror').find('span');
       srchErrorLabel.text('Place user friendly message here'); 
   })

July 15th, 2013 3:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics