none
remove some particular filenames from result source - SharePoint Online RRS feed

  • Question

  • Hi All,
    My scenario is i dont want users to be able to search some particular list with Allitems.aspx and AllPosts.aspx.
    I tried using the below in my result source:-

     {?{searchTerms} -Filename:abc/sites/xxx/yyy/Pages/Forms/AllItems.aspx}

    But had no luck in my search result 

    Any ideas where best to remove this pages and whats the best practice as i don't want it for all the lists etc..
    Thanks in advance

    Friday, November 15, 2019 6:28 AM

All replies

  • Do you want to exclude the content as well or only list and library names with icons/links to lists or libraries?

    If you want to exclude a list from search results, you can configure the list not to include in search results.

    To exclude all the items in the document library or list from appearing in to search results:

    1. Navigate to the List
    2. Go to list Settings
    3. Then go to advanced settings of the list and check the option to remove from search results at the bottom. i.e. Allow items from this list to appear in search results? to NO.

    This will stop the search from hitting that specific list or document library.

    Below article for your reference:

    https://social.technet.microsoft.com/Forums/sharepoint/en-US/f53ec882-333e-4061-941d-18722952871b/exclude-lists-from-search-results?forum=sharepointsearchlegacy

    Thanks & Regards,


    sharath aluri

    Friday, November 15, 2019 6:36 AM
  • Hi, Patrick,

    I assume you only want to make the users not able to search for the all items view. They shall still be able to see contents created by themselves. If that is not your scenario, please let me know.

    Did you wan to remove it temporarily or for a long period? If you want to do it for a short period, you can try to Remove search results. It will remove the url immediately. But This is only a quick fix! Unless you delete the items or change the permissions of items manually, they will show up again in your search results after the next crawl.

    If you are handling with end users with contribute permission and always don't want them to be able to search the allitems. Try to use the item-level permission in your required list.  How to enable Item Level Permissions in SharePoint. They can still search the items created by themselves. However, the allitems.aspx will not return.

    Best Regards

    Jerry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, November 18, 2019 2:48 AM
  • Thanks Sharath only i want is to hide/remove the  allposts.aspx and  allitems.aspx pages from the search result.
    Is it also possible to replace them with another page?

    Thanks in Advance

    Monday, November 18, 2019 11:38 PM
  • Thanks Jerry the only thing i want is to hide/remove the  allposts.aspx and  allitems.aspx pages from the search result returned.

    The reason is i have a custom page that returns the same data but with a different layout. Will i be a able to replace the allitems.aspx with the custom page or is it possible to return a custom page in the search result?

    Thanks in Advance

    Monday, November 18, 2019 11:46 PM
  • Tuesday, November 19, 2019 2:36 PM
  • Hi, Patrick,

    Sorry for the late reply. I tried with several approaches and find a way to remove allitems.aspx from search result. You need to create a new result source. Here is how to manage result source

    Keep everything as default and in query transform, launch the query builder. Add the following query for the query test:

    {searchTerms} -filename:allitems.aspx -filename:allposts.aspx

    It is like this:

    For more information about the query, have a check here:https://docs.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference?redirectedfrom=MSDN

    I am not sure if you can replace it with a custom page. There are approaches like promoted results and result blocks which you can have a look at:Manage query rules

    https://veronicageek.com/office-365/sharepoint-online/create-promoted-results-sharepoint/2017/12/

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    Best Regards

    Jerry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Proposed as answer by Michael Han6 Tuesday, November 26, 2019 9:11 AM
    Friday, November 22, 2019 9:38 AM
  • Hi, Partick,

    Have you tried the solution? Is there any update about your issue? You can mark the reply as answer if you find it helpful.

    Best Regards

    Jerry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, December 3, 2019 8:20 AM