Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I got a default message from sharepoint search as like:

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

And I want to change the wording with more user friendly way. Which part should I take a look?

share|improve this question
    
What are you trying to do when you get this message? –  LCountee Dec 6 '12 at 20:46
add comment

3 Answers

up vote 3 down vote accepted

Sanghoon,

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 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

share|improve this answer
    
Thanks vgrem, looks good. –  Sanghoon Dec 6 '12 at 23:33
add comment

Edit the Results page, look for the Core Results Web Part, Edit that (to bring up the toolpane), locate the XSL Editor in the toolpane, and find the text you want to edit in the XSLT (copy/paste it into Notepad for easier editing) and save it back in.

Plenty of tutorials on the web for doing it, here's one:

http://www.c-sharpcorner.com/UploadFile/Roji.Joy/how-to-customize-search-results-in-sharepoint-2010/ (skip the Fetched Columns bit)

You can find others by searching the web for 'Customise SharePoint Core Search Results web part xslt'.

share|improve this answer
add comment

This only works on the initial page load. You can implement the error message in the xsl for this web part: Change the last div of <xsl:template name="dvt_1.empty"> (<div class="srch-results" accesskey="W"> to be your error message:

<div class="srch-results" accesskey="W">
  <span class="srch-description2" id="CSR_NO_RESULTS">
   <p>Your error message here...</p>
  </span>
</div>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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