<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.dotnetmafia.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Corey Roth [MVP] : Office 365 Grid, SharePoint Online, Enterprise Search</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Office+365+Grid/SharePoint+Online/Enterprise+Search/default.aspx</link><description>Tags: Office 365 Grid, SharePoint Online, Enterprise Search</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Importing Search Configurations with SharePoint Apps</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/04/03/importing-search-configurations-with-sharepoint-apps.aspx</link><pubDate>Wed, 03 Apr 2013 16:21:44 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:6255</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=6255</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/04/03/importing-search-configurations-with-sharepoint-apps.aspx#comments</comments><description>&lt;p&gt;The Office Developer Tools team snuck a new feature into the RTM version of the tools for Visual Studio 2012.&amp;#160; This new feature allows you to deploy apps and actually &lt;em&gt;alter the search schema on the host web&lt;/em&gt;.&amp;#160; That’s right.&amp;#160; You can deploy an app and it will directly change the search configuration on the host.&amp;#160; They just released &lt;a href="http://msdn.microsoft.com/en-us/library/office/apps/dn194077.aspx"&gt;documentation&lt;/a&gt; on it a while back, but as usual, I wanted to share my experiences.&amp;#160; That and I know you all like screenshots.&lt;/p&gt;  &lt;p&gt;What does this feature actually do?&amp;#160; Well let’s back up a bit.&amp;#160; If you remember back from my post, &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2012/07/17/what-you-need-to-know-about-search-in-sharepoint-2013-preview.aspx"&gt;Search is Everywhere&lt;/a&gt;, I mentioned the we now had the ability to export and import search settings.&amp;#160; This works at the SSA, site collection, and site level and allows you to move everything from result sources to managed properties from one environment to another.&amp;#160; This is big as it lets you finally promote search settings between environments and maintain a true SDLC when it comes to search.&amp;#160; Why do we care about search configuration with apps?&amp;#160; Well this allows the developer to package up search settings in Visual Studio 2012 and then move them to production without having to do manual steps or use PowerShell.&amp;#160; This also means you could include search settings in an app that you would put in the Office Store.&amp;#160; It certainly opens up possibilities.&lt;/p&gt;  &lt;p&gt;To test this out, go to your source site collection and customize your search settings.&amp;#160; In my example, I created a custom result source and some managed properties on our source site.&amp;#160; In my example, I actually did this on an on-premises installation of SharePoint 2013.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationResultSourceSite1_5F4169CA.png"&gt;&lt;img title="SearchConfigurationResultSourceSite1" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="SearchConfigurationResultSourceSite1" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationResultSourceSite1_thumb_11A53D4A.png" width="465" height="299" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This particular result source does nothing exciting.&amp;#160; It simply limits the search to documents, but it serves as a good example.&amp;#160; I’ve also created a managed property mapped to the Author crawled property.&amp;#160; You may already know about this part, but I am showing it for a reason.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationManagedPropertySite1_3FFEC2F7.png"&gt;&lt;img title="SearchConfigurationManagedPropertySite1" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="SearchConfigurationManagedPropertySite1" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationManagedPropertySite1_thumb_59D2F926.png" width="466" height="281" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now, I am going to export my search settings of my site collection, by going to Site Settings –&amp;gt; Search –&amp;gt; Configuration Export.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SiteCollectionSearchSettingsExport_1A0912A1.png"&gt;&lt;img title="SiteCollectionSearchSettingsExport" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="SiteCollectionSearchSettingsExport" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SiteCollectionSearchSettingsExport_thumb_0C36CCA6.png" width="209" height="199" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;At this point, I could manually import the search settings using Configuration Import on another site collection.&amp;#160; However, we want to do this from an app.&amp;#160; Let’s get started in Visual Studio 2012.&amp;#160; Start by creating a new SharePoint-hosted app.&amp;#160; Once it is created, add an item to the project and choose &lt;em&gt;Search Configuration&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/VS2012SearchConfigurationSPI_4C6CE620.png"&gt;&lt;img title="VS2012SearchConfigurationSPI" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="VS2012SearchConfigurationSPI" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/VS2012SearchConfigurationSPI_thumb_2194820E.png" width="501" height="348" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The next step will ask for the path to your configuration XML file that you exported.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/VS2012SearchConfigurationImportSettings_33DD48D0.png"&gt;&lt;img title="VS2012SearchConfigurationImportSettings" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="VS2012SearchConfigurationImportSettings" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/VS2012SearchConfigurationImportSettings_thumb_0D0F3290.png" width="475" height="375" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;At this point the process is done.&amp;#160; It will show you an XML editor with the contents of your search configuration.&amp;#160; According to the MSDN documentation, you then need to edit it and set the &lt;em&gt;DeployToParent&lt;/em&gt; element to &lt;em&gt;true&lt;/em&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationDeployToParentTrue_6236CE7D.png"&gt;&lt;img title="SearchConfigurationDeployToParentTrue" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="SearchConfigurationDeployToParentTrue" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationDeployToParentTrue_thumb_3B68B83D.png" width="473" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We then need to grant permissions to access the Site Collection.&amp;#160; To do this, open &lt;strong&gt;AppManifest.xml &lt;/strong&gt;and then click on &lt;em&gt;Permissions&lt;/em&gt;.&amp;#160; On this tab, add a scope of &lt;em&gt;Site Collection&lt;/em&gt; and set the value to &lt;em&gt;Full Control&lt;/em&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/VS2012SearchConfigurationAppManifestPermissions_0DE7987A.png"&gt;&lt;img title="VS2012SearchConfigurationAppManifestPermissions" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="VS2012SearchConfigurationAppManifestPermissions" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/VS2012SearchConfigurationAppManifestPermissions_thumb_42F427AA.png" width="469" height="138" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;At this point, we are are ready to deploy.&amp;#160; In my example, I am taking my search configuration and deploying it to an Office 365 SharePoint Online tenant.&amp;#160; When the app deployment completes, you’ll be prompted if you want to trust the app.&amp;#160; Trust it and then you should see your app start page.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/VS2012SearchConfigurationDeploymentTrust_3CAD511C.png"&gt;&lt;img title="VS2012SearchConfigurationDeploymentTrust" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="VS2012SearchConfigurationDeploymentTrust" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/VS2012SearchConfigurationDeploymentTrust_thumb_2AD0BD4F.png" width="454" height="270" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;At this point, you are just going to see you default app start page.&amp;#160; There is nothing visible in the application.&amp;#160; Go to the Developer Site (or the site collection you deployed to) and go to the Site Settings.&amp;#160; Then look at the Result Sources.&amp;#160; If everything worked correctly, you should now see your new result source there.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationResultSourceDeployed_0402A70F.png"&gt;&lt;img title="SearchConfigurationResultSourceDeployed" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="SearchConfigurationResultSourceDeployed" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationResultSourceDeployed_thumb_5D3490CE.png" width="456" height="294" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It was successfully deployed.&amp;#160; Now what about the managed property?&amp;#160; Unfortunately, it is no where to be found.&amp;#160; If you go back to Visual Studio and look at your XML, you’ll notice that your managed property definition is no where to be found there either.&amp;#160; If you check the source file before you imported it though, you’ll see the definition.&amp;#160; After I noticed this particular behavior, I reached out on Twitter and &lt;a href="http://twitter.com/chakkaradeep"&gt;@chakkaradeep&lt;/a&gt; reached out to me and told me that managed properties aren’t supported in this deployment model.&amp;#160; That made me kind of sad because that’s what I want to deploy the most.&amp;#160; I’m sure there is a technical reason though that he’ll explain to me sometime though.&amp;#160; You can still deploy managed properties via Configuration Import though which is still a great added feature of SharePoint 2013.&lt;/p&gt;  &lt;p&gt;You might be curious if the result source is removed when you uninstall the app.&amp;#160; It turns out that the changes are indeed removed when you uninstall.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationResultSourceRemoved_1D6AAA49.png"&gt;&lt;img title="SearchConfigurationResultSourceRemoved" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="SearchConfigurationResultSourceRemoved" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SearchConfigurationResultSourceRemoved_thumb_5DA0C3C3.png" width="397" height="264" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Aside from the managed properties not being available, this is still a pretty cool feature and it has me thinking about some new things I can do that I didn’t think were possible before.&amp;#160; I’m pretty excited to work with it more.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=6255" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Enterprise+Search/default.aspx">Enterprise Search</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint+Online/default.aspx">SharePoint Online</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Office+365/default.aspx">Office 365</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Office+365+Grid/default.aspx">Office 365 Grid</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Visual+Studio+11/default.aspx">Visual Studio 11</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint+2013/default.aspx">SharePoint 2013</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Apps/default.aspx">Apps</category></item><item><title>Determining the most popular items in a document library in SharePoint 2013</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/03/28/determining-the-most-popular-items-in-a-document-library-in-sharepoint-2013.aspx</link><pubDate>Thu, 28 Mar 2013 19:39:39 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:6248</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=6248</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/03/28/determining-the-most-popular-items-in-a-document-library-in-sharepoint-2013.aspx#comments</comments><description>&lt;p&gt;With the combination of &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2012/07/17/what-you-need-to-know-about-search-in-sharepoint-2013-preview.aspx"&gt;analytics and search&lt;/a&gt; in SharePoint 2013, there is a heap of new features to help determine which content is actually being used.&amp;#160; No longer is this information buried in reports for administrators, but it in fact is available right from the ribbon in a document library.&amp;#160; Maybe you have even noticed the &lt;em&gt;Most Popular Items&lt;/em&gt; button in the ribbon already.&amp;#160; You can find it on the library tab in the middle.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/DocumentLibraryMostPopularItemsRibbonButton_36C6C038.png"&gt;&lt;img title="DocumentLibraryMostPopularItemsRibbonButton" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="DocumentLibraryMostPopularItemsRibbonButton" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/DocumentLibraryMostPopularItemsRibbonButton_thumb_123532B4.png" width="493" height="212" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Click on it and you will be taken to a custom search results screen that shows you recent views and total views.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/MostPopularItemsReport_6AFAE97E.png"&gt;&lt;img title="MostPopularItemsReport" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="MostPopularItemsReport" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/MostPopularItemsReport_thumb_7CD77D4B.png" width="551" height="405" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;What’s nice is that you can even search and refine within the report if you are looking for something specific.&amp;#160; You can also click on the &lt;em&gt;Popularity Trends&lt;/em&gt; link to get a nice graph of the usage of the file over time.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/PopularityTrendsReportExcel_3177D987.png"&gt;&lt;img title="PopularityTrendsReportExcel" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="PopularityTrendsReportExcel" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/PopularityTrendsReportExcel_thumb_70D58D17.png" width="548" height="451" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Behind the scenes, this report is powered by the &lt;em&gt;Popular&lt;/em&gt; result source.&amp;#160; You can also use this source to look for popular items across your entire index.&amp;#160; As a developer, the possibilities are quite interesting.&lt;/p&gt;  &lt;p&gt;My particular tenant doesn’t have a ton of usage, but if you’re already running SharePoint 2013 you might be able to extract some valuable insights from this report.&amp;#160; Try it out today.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=6248" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Document+Library/default.aspx">Document Library</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Enterprise+Search/default.aspx">Enterprise Search</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint+Online/default.aspx">SharePoint Online</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Office+365/default.aspx">Office 365</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Office+365+Grid/default.aspx">Office 365 Grid</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint+2013/default.aspx">SharePoint 2013</category></item><item><title>Speaking at Office 365 Saturday Redmond!</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2012/02/22/speaking-at-office-365-saturday-redmond.aspx</link><pubDate>Wed, 22 Feb 2012 21:45:29 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:5570</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=5570</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2012/02/22/speaking-at-office-365-saturday-redmond.aspx#comments</comments><description>&lt;p&gt;I’m excited to be speaking at the first &lt;a href="http://o365redmond.sharepoint.com/Pages/default.aspx"&gt;Office 365 Saturday&lt;/a&gt; in Redmond on 2/25.&amp;#160; This new event will be an exciting display of all things Office 365.&amp;#160; I’ll be talking about all of the cool things you can do with Search in SharePoint Online.&amp;#160; I gave this talk at SPC11, but I gave the talk an upgrade with the use of Visual Studio 11 Developer Preview.&amp;#160; We’ll look at what you can do out-of-the-box with search and then write a custom Silverlight application to query search web services.&amp;#160; If you’re looking to get more out of search be sure to stop by and check out my session.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=5570" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Enterprise+Search/default.aspx">Enterprise Search</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Presentations/default.aspx">Presentations</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint+Saturday/default.aspx">SharePoint Saturday</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint+Online/default.aspx">SharePoint Online</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Office+365/default.aspx">Office 365</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Office+365+Grid/default.aspx">Office 365 Grid</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Visual+Studio+11/default.aspx">Visual Studio 11</category></item><item><title>How to: Query sites and site collections using SharePoint Search</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2012/01/13/how-to-query-site-and-site-collections-using-sharepoint-search.aspx</link><pubDate>Fri, 13 Jan 2012 19:41:21 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:5459</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=5459</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2012/01/13/how-to-query-site-and-site-collections-using-sharepoint-search.aspx#comments</comments><description>&lt;p&gt;I often refer to my &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/07/20/some-handy-keywords-you-might-find-useful-in-sharepoint-enterprise-search.aspx"&gt;Handy Keywords in SharePoint Search&lt;/a&gt; because it forms the building blocks you need to become a rock star at writing SharePoint keyword queries.&amp;#160;&amp;#160; Today, I want to expand upon that post on how you can use search to return a list of sites or site collections.&amp;#160; This is useful when you want to quickly inspect a SharePoint farm using the Search Center.&amp;#160; The secret behind returning sites with Search is use of the c&lt;em&gt;ontentclass&lt;/em&gt; managed property.&amp;#160; You just have to know what value to specify.&amp;#160; To return a list of all sites in the search index, we specify a value of &lt;em&gt;STS_Web &lt;/em&gt;(remember our &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/08/21/sharepoint-to-api-translation-guide.aspx"&gt;translation guide&lt;/a&gt;).&amp;#160; Here is what it looks like.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;contentclass:&amp;quot;STS_Web&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SPOSearchSites_397779CA.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="SPOSearchSites" border="0" alt="SPOSearchSites" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SPOSearchSites_thumb_3E79B779.png" width="568" height="385" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;This works pretty well.&amp;#160; However, if you inspect the results on your own server, you might quickly notice one thing missing.&amp;#160; The root web of all the site collections is not present in the search results.&amp;#160; To get the site collections, we specify &lt;em&gt;STS_Site&lt;/em&gt; instead.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;contentclass:&amp;quot;STS_Site&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SPOSearchSiteCollections_276B363D.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="SPOSearchSiteCollections" border="0" alt="SPOSearchSiteCollections" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SPOSearchSiteCollections_thumb_73C2C9DE.png" width="561" height="385" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Notice, I now have all of the site collections on my particular tenant.&amp;#160; If you want the results combined, you simply combine the queries.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;contentclass:&amp;quot;STS_Site&amp;quot; contentclass:&amp;quot;STS_Web&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SPOSearchSitesAll_7858D498.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="SPOSearchSitesAll" border="0" alt="SPOSearchSitesAll" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SPOSearchSitesAll_thumb_36DE223F.png" width="565" height="404" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now you might be thinking this is great, but you don’t want every site and site collection on the farm.&amp;#160; You want to restrict it to a particular web application.&amp;#160; That’s actually pretty easy, just refer back to the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/07/20/some-handy-keywords-you-might-find-useful-in-sharepoint-enterprise-search.aspx"&gt;handy keywords&lt;/a&gt; post and use the &lt;em&gt;Site&lt;/em&gt; managed property.&amp;#160; In my case, I’ll restrict the URL to my main web application.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;contentclass:&amp;quot;STS_Site&amp;quot; contentclass:&amp;quot;STS_Web&amp;quot; site:&lt;a href="https://dotnetmafia.sharepoint.com"&gt;https://dotnetmafia.sharepoint.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SPSitesAllRestricted_748B09FB.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="SPSitesAllRestricted" border="0" alt="SPSitesAllRestricted" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/SPSitesAllRestricted_thumb_79F97A9F.png" width="564" height="389" /&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;There are lots of ways to get lists of sites in SharePoint, but I find this one works well since it doesn’t require a line of code for you to try.&amp;#160; Of course, as a developer, you can make use of this with the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/08/12/how-to-use-the-sharepoint-2010-enterprise-search-keywordquery-class.aspx"&gt;&lt;em&gt;KeywordQuery&lt;/em&gt;&lt;/a&gt; class inside your own application.&amp;#160; This works with SharePoint on-premises as well as SharePoint Online.&amp;#160; All screenshots were from my personal SPO site.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=5459" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Enterprise+Search/default.aspx">Enterprise Search</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint+Online/default.aspx">SharePoint Online</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Office+365/default.aspx">Office 365</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Office+365+Grid/default.aspx">Office 365 Grid</category></item></channel></rss>