I have a site which uses cross-site publishing to connect a catalog of learning courses to my site, but there are also some pages of actual content on the site -- help, contact, and a few others as well. So here is the first thing I have to do which should be OOTB I have to create a new result source with the catalog information AND the current site.

{searchTerms?} ( (contentclass:sts_listitem OR IsDocument:True) SPSiteUrl:https://<catalog site> ListId:<guid>) OR Site:**<siteurl>**

Step 2 I have to go into Site settings > Search and offline availability and tick the Always index all web parts or none of the content on my pages will show up.

Step 3 I have to go to all the "behind the scenes" libraries and lists Like Images and Site Assets and mark them to not be included in the search.

Step 4 I need to hide the pages that actually display the libraries from search, because step three doesn't actually hide those. So there I found this tip which is basically to add the following to either my result source or the in my search results web part query builder.


I'm also using managed navigation so for Step 5 I need to go and check that all of my publishing pages have Hide physical URLs from Search is ticked.

The catalog of learning includes some technical titles so users might search on something like html. For some reason the site I'm on and any remaining web part pages that I have come up and are by default sorted to the top of the list.

Neither of those things are in any way the best match for html. I have two content types of the actual content so I thought I would use a dynamic sort order to boost those content types. Step 6 was to add that to the results webpart query, but it looks like there is a bug and as soon as I save the page the webpart loses them. So I added the following directly into my query builder.

XRANK(cb=5000) ContentType:Curriculum XRANK(cb=4000) ContentType:Course

That remained, but the results part still puts pages and the site itself about the other results.

Step 7 Is to go to Site settings > Advanced settings > Reindex for each library and list that I made changes to. And also Site settings > Search and offline availability.

TL;DR Here are the questions

How do I prevent search results from promoting the site itself to the top of the list? There is never a time that a person on my site needs to search and get my site as the top result — they are already here.

How do I tell SharePoint that a search for html should return learning items which contain html in the body of the text (or other metadata) and not to return site pages that don't include that in any of their content or metadata?

  • Have you try the query rules? When user search for 'html', promote certain results and demote irrelevant results. – YogaPanda Oct 26 '16 at 21:51
  • Thanks. That is a good idea. Just that there is no reason that I can see for the ranking of those pages when searching on 'html' and I wonder what other lurking words are out there that a user might use. – Rothrock Oct 26 '16 at 21:53
  • 1
    I run the popular search trend report frequently and see the most popular search term. Create promoted search result based on that :) – YogaPanda Oct 27 '16 at 12:55

Half answer for how to prevent returning the site itself. I found this thread. Daniel Lewis's answer shows:

contentclass:"STS_Web" contentclass:"STS_Site"

And I just negated those and voila! no more site in the search results.

Still have no idea while searching on html returns results of things that don't include those words.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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