How to: search the contents of a document set

Posted Wednesday, November 9, 2011 4:03 PM by CoreyRoth

I saw this question in the forums the other day, so I decided to see if it is possible to use SharePoint search to query just the contents of a document set.  It turns out that you can and it is quite easy.  Consider the following document set.  It has a number of contracts in it.

image

I want to be able to search the content of the document set.  Document Sets are really just fancy folders.  You can tell this by examining the URL when you are viewing one.  Since it is just a folder, I realized that we can make use of the Site keyword that I have talked about before.  Simply provide the URL and you will return all of the results of the document set.  Here is an example.  I can return the entire contents of the document set like in this example.

site:"http://sp2010/RM Test/Work Package 1/"

In the above example, my server is sp2010, the document library is RM Test and the document set is named Work Package 1.  Here are the search results.  Note, that it returns the documents in the document set as well as the welcome page.

DocumentSetSearchResultsFull

Of course we can combine this with other terms.  For example if I want to search for documents in this set that involve the state of Texas, I would issue the following query.

site:"http://sp2010/RM Test/Work Package 1/" Texas

DocumentSetSearchResultsTexas

As you can see querying the document set is easy.  Now your users might not be able to create a query like that very easily, but as a developer it gives you something to work with.  To search within large document sets, you could add a custom SearchBoxEx web part to the welcome page.  The reason you would have to customize it is because you need the site keyword to pass in the URL of the document set.  This could be done by inheriting from SearchBoxEx and by adding some simple code to get the current URL.  I’ll look at building this web part in the future when I have more time.  In the meantime, if you build one, drop me a line and tell me about it.

Comments

# Sladescross's Blog

Thursday, November 10, 2011 4:21 AM by Sladescross's Blog

Pingback from  Sladescross's Blog

# Sladescross's Blog

Thursday, November 10, 2011 4:21 AM by Sladescross's Blog

Pingback from  Sladescross's Blog

# Sharepoint Updates November-10-2011 | SDavara's Sharepoint Knowledge Center

Pingback from  Sharepoint Updates November-10-2011 | SDavara's Sharepoint Knowledge Center

# SharePoint Daily » Blog Archive » All Microsoft Products Lead to the Cloud; Silverlight Exit Strategy; Spellcheck in IE10

Pingback from  SharePoint Daily  » Blog Archive   » All Microsoft Products Lead to the Cloud; Silverlight Exit Strategy; Spellcheck in IE10

# All Microsoft Products Lead to the Cloud; Silverlight Exit Strategy; Spellcheck in IE10

Friday, November 11, 2011 7:48 AM by SharePoint Daily

Don't forget, SharePoint Saturday Denver starts today. Stop by the Bamboo booth for details on our

# re: How to: search the contents of a document set

Wednesday, November 30, 2011 11:18 PM by Uday

Thanks for this blog,

Nice blog.

# re: How to: search the contents of a document set

Friday, February 3, 2012 11:37 AM by Rajesh

I have a almost opposite requirement to show only the document set when the search keyword is contained either in the document set or in any of the documents within that document set. Currently what happens is when a text is contained within in any of the document(s), all those documents are returned. Instead I would want the search to show only the document set, so there will be one result per document set. Is this possible?

# re: How to: search the contents of a document set

Monday, February 6, 2012 11:45 PM by CoreyRoth

@Rajesh Try using the ContentType keyword passing the Document Set content type.  I haven't tried it but it might work.  www.dotnetmafia.com/.../some-handy-keywords-you-might-find-useful-in-sharepoint-enterprise-search.aspx

# re: How to: search the contents of a document set

Tuesday, May 13, 2014 3:34 AM by Ben

Hi,

I have the same requirement as Rajesh, but I'm using SP2013.

Corey or Rajesh, did you find a solution for this problem?

Thanks

# re: How to: search the contents of a document set

Tuesday, June 10, 2014 9:48 PM by Inder

Dear Corey,

We have one file share and and users want to Display Parent folder in search results as refinement like we have for Word/Excel/PPT/Author etc. Please let me know how to achieve it in Fast Search for SP 2010. Thanks.

Regards,

Inder

# All Microsoft Products Lead to the Cloud; Silverlight Exit Strategy; Spellcheck in IE10 – Bamboo Solutions

Pingback from  All Microsoft Products Lead to the Cloud; Silverlight Exit Strategy; Spellcheck in IE10 – Bamboo Solutions

# re: How to: search the contents of a document set

Friday, November 11, 2016 2:10 PM by Craig

I have a site with hundreds of docsets in a library. How do we search all of them and return the docset rather than the file inside?

Leave a Comment

(required)
(required)
(optional)
(required)