In SharePoint Server 2010, say I set up a Document Set and put some Word documents in it. Each Word document contains a common phrase that is found only in the body of the Word Documents.

When searching for this common phrase that exists in each of the Word Documents, is there a way to return only the Document Set in the search results, instead of returning each individual Word document?

1 Answer 1


Default on search, metadata from the set is included for all the documents as well. If you search and match a metadata field from the set you get hits on the documents as well as the set itself.

The opposite cannot be achieved directly, letting the content of the documents appear as metadata for the set itself.

In order to do this you need to create a custom search web part which executes two searches. First you execute your regular query, then for each document you have to hash up the set id´s and generate your own result list which i returned to the user.

I haven´t worked with sets myself so I´m not sure if the set id is returned with the meta data per hit, or if you have to query it from the list afterwards.

  • Thanks for your answer Mikael. It looks like there will need be some kind of custom code layer to perform this; though I'm wonder if there is an optimal solution in terms of performance.
    – 9b5b
    Sep 16, 2011 at 15:54
  • Two searches shouldn't be that expensive, and I can't really think of a different approach here (which I would go for). Sep 16, 2011 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.