2

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?

Marek Grzenkowicz
  • 17,024
  • 9
  • 81
  • 111
9b5b
  • 1,508
  • 11
  • 20

2 Answers2

1

Use this syntax:

http://yoursite/_layouts/OssSearchResults.aspx?k=[searchterms]site:" http://yoursite/yourlibrary/yourfolderordocset"

Found this here

mata
  • 67,110
  • 10
  • 163
  • 162
gbelzile
  • 84
  • 2
  • Please see [this answer that may help you with audit table mining](http://stackoverflow.com/a/16243274/57611). Your answer was deleted so I could not comment there--my apologies. – ErikE Apr 26 '13 at 18:53
0

Customize the XSLT

If the phrase is always the same, you can create a search page just for this search. From the post it is not clear whether you would need a scope, you could use a limited search, i.e. 'this list' type of thing. You can customize the core results web part to add the column with the doc set name/title. Update the XSLT to only show the doc set name/title of items in the search results. This assumes that the results are only doc sets, if the search will return doc sets mixed in with other items, you can still include conditional logic in the XSLT to only display the doc set title/name when the search item is a doc set.

Samples

Merging documents with identical schema -- or in your case, combining like elements in the same schema. (from solution 6.4 in the book)

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indent="yes"/>

<xsl:param name="doc2"/>

<xsl:template match="/*">
   <xsl:copy>
      <xsl:copy-of select="* | document($doc2)/*/*"/>
   </xsl:copy>
</xsl:template>

</xsl:stylesheet>

Perform set operations, like a union on node sets using XPath. (from solution 7.1 in the book)

<xsl:copy-of select="$node-set1 | $node-set2"/>

Book Recommendation

XSLT Cookbook by Sal Mangano, published by O'Reilly

Kelly S. French
  • 12,198
  • 10
  • 63
  • 93
  • I assume xslt would need customization, yes, but it's the caveats that are tough here. For example, one would need to eliminate duplicate records if the same doc set was matched twice (for different child docs). I think to duplicate the standard functionality, a lot of metadata fields and xslt processing would be required. – 9b5b Jul 13 '12 at 02:37
  • Between XSLT and XPath, it can be done. I will expand on it my my answer. – Kelly S. French Jul 13 '12 at 19:55