Question

I am using the following query in my search center to only display documents (Word, Powerpoint, etc.):

IsDocument:1

The desired result set is all documents (like above) and all document sets combined. What is the correct search query to make this happen?

Was it helpful?

Solution

To make this happen you need to add a Managed Property in your Search Service Application. You find the existing Managed Properties in the Queries and Results section named Search Schema. Type isDocument in the filter section and hit the green button with a white arrow. You should see this:

enter image description here

It tells is that the isDocument managed property returns all documents in SharePoint and that they are queryable and retrievable. But if we search for isDocumentSet or documentSet we get no results. We need to add it.

Click the Crawled Properties link just below the page title. On the crawled properties page, search for documentset and you see the ows_DocumentSetDescription. Good news! Our Search Service Application gathers the information from the document set description. Bad news, we can’t search on it (yet).

enter image description here

Go back to the Managed Properties page and click the New Managed Property link. Give it a descriptive name (isDocumentSet) and check the Queryable and Retrievable checkboxes.

enter image description here

Further down on the page, map this managed property to the ows_DocumentSetDescription crawled property. Save the property and make a full crawl (incremental should do, but just to be sure, make it a full one).

Now you have both isDocument and isDocumentSet to search for. When you search for either document or document set, your search string should be “isDocument:1 OR isDocumentSet”.

enter image description here

More to read:

OTHER TIPS

Try changing your query to IsDocument=1 OR ContentType="Document Set".

You could use the following in your query to include any Document Set Content Types:

ContentTypeId:0x0120D520*
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top