2

We are using SharePoint 2016. I have added a ContentBySearchWebpart on the welcome page. Here I show the recently added/modified documents. In the search results I see allot of OneNote results because search is showing OneNote sections and not OneNote document. How can hide the OneNote sections in the search results and allow OneNote documents?

This is my search query:

(Author:{User.Name} OR ModifiedBy:{User.Name}) AND IsDocument:1

3

You can exclude files with the .one extension, which represent OneNote sections, by adding NOT FileType:"one" to your search query.

Note that OneNote notebooks are really folders, not documents, so you'll need to remove the IsDocument:1 property restriction to get them to appear in your search results.

You can add a property restriction of contentclass:STS_ListItem to get any type of list item, folder, or document (excluding sites, lists, and libraries) although that will also include things like tasks unless you explicitly exclude them.

  • thank you. I will try this solution and let you know if it works. – Ola Nov 20 '18 at 19:17
  • It looks like it works, but because I removed IsDocument:1 I see now also other results like pictures in picturelibraries and sites. I would like to show only the results like: OneNote, Word, Excel, PowerPoint, Access, PDF. How can I do this? – Ola Nov 22 '18 at 8:43
  • I believe instead of IsDocument:1 you can add a property restriction of contentclass:STS_ListItem to get any type of list item, folder, or document (excluding sites, lists, and libraries) although that would also include things like tasks unless you explicitly exclude them. – Thriggle Nov 26 '18 at 22:54

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.