I would like to hide library (the AllItems.aspx) views from the search results, but the content should still show up. Tried to make a crawl rule with a filter on all AllItems.aspx pages, but that did not work.

Is there any trick to get this working?


Method 1:

Go to Central administration > Manage service applications > Search service application > Crawl rules . Use the belwo configuration and create a crawl rule.

Path = ://*/AllItems.aspx

Crawl configuration = Exclude all items in this path (check “Exclude complex URLs (URLs that contain question marks – ?)”)

Specify authentication = Use the default content access account (or use other suitable option for your project)

Now do a full crawl, then all the */allitems.aspx pages will be excluded from crawling.

Edit: This method also excludes the documents in that library , if there is no other link to those documents in other pages.

Method 2:

Also, if you want that only for one Search results page the allitems.aspx needs to be excluded , then you can just edit the Search results webpart and edit the Query to add this --> -filename:allitems.aspx

Here you don't need any central administration access or full crawl to be done. Please see this blog.

|improve this answer|||||
  • I went with Method1, because there is currently no option for Method2. And with that crawl rule, also my documents are gone from search after a full crawl – Florian Leitgeb Jul 22 '15 at 10:03
  • Looks like method 1 prevents the documents also from appearing in the search result and you will have to go with Method 2 instead. See this stevemannspath.blogspot.co.at/2013/04/… – Unnie Jul 22 '15 at 10:09
  • Unfortunately this is a osssearchresults.aspx which has no edititing option – Florian Leitgeb Jul 23 '15 at 9:37
  • 1
    you can create another page in Pages library and add search results webpart, search box and refiner webpart to that page. Make the query change as mentioned in Method 2. Then in the search settings of the sitecollection, change the search results page url to this page – Unnie Jul 23 '15 at 9:40
  • 1
    Would like to mark this as the answer, but the Method1 is simply not working, so it would be not the correct answer :/ – Florian Leitgeb Jul 23 '15 at 12:32

For me it excluding AllItems.aspx was a hit and miss. Have a look here http://practicalsharepoint2010.blogspot.com.es/2011/12/search-configuration-best-practices.html maybe it will work for you. When using this approach for some reason on the SP2010 I still had problems with crawling infoPath form libraries.

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