6

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?

5

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:

  • @BennySkogberg Thanks for the great answer. I followed all steps but unfortunately it isn't working. IsDocumentSet gives 0 results – Citizen SP Jan 15 '16 at 14:35
  • @CitizenDB You're welcome :) Do you have description in your document set? – Benny Skogberg Jan 15 '16 at 14:36
  • @BennySkogberg it is not working yet. The query I am using is: IsDocument:1 OR IsDocumentSet – Citizen SP Jan 18 '16 at 7:03
  • @CitizenDB Hmm, strange. If you have description in DocSet it should work. Can you check crawl status? Does your document sets get crawled properly? – Benny Skogberg Jan 18 '16 at 7:09
  • description: check, crawl status:check. Dcument set has 2 crawled properties: ows_DocumentSetDescription & ows_r_MTXT_DocumentSetDescription. I am now using the first as managed property. – Citizen SP Jan 18 '16 at 7:22
2

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

1

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

ContentTypeId:0x0120D520*

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.