Dienstag, 29. Mai 2012

Search Driven Applications with Office 365 / SharePoint Online - Part I

Part I: Common stuff about Search Driven Applications and first solution proposal with Office 365 / SharePoint Online.

I wrote about building Search Driven Application with SharePoint 2010 some stuff and also some of my sessions during conferences were around this. For example here are some links:

Article in SharePoint Magazine:

Video from last year Collaboration Days: (http://www.collaborationdays.ch )

You can build Search Driven Applications in several different ways and based on different techniques. One of the easiest is using the Query Object Model from the SharePoint Search to create “Fixed Keyword Queries”. For example this query shows all SharePoint sites which you have access to:
contentclass:STS_Site contentclass:STS_Web contentClass:sts_listitem_850
For more Details have a look at the BlogPost from Laura Rogers: LINK

But the “magic” within Search Driven Solution is aggregating some similar crawled properties together in one managed property. See schema diagram:
Example: you have two lists in your SharePoint farm which both contains information about customers. Because of some historical reasons, maybe migration from SharePoint 2007 or merging from other systems, these are both independent and different fields in different SharePoint List. Merging this two Crawled Property together in one Managed Property called for example “cKunde” allowed you querying both fields with one call (for example: cKunde:AOL - you will get results from both list). Pooling Crawled Properties in Managed Properties as shown in the next picture is one of the technical basics for Search Driven Application:

Pooling properties is no problem in a SharePoint on premise installation. But with Office 365 / SharePoint Online we ran in some problems. The main problem is that we cannot configure the Search Service Application in Office 365 / SharePoint Online. So we are not able to do the merge from Crawled to Managed Properties, and without Managed Properties we are not able to query the content for specific issues. We can of cause use the given default Managed Properties like “Author, Filetype, Name etc.” and build Search Driven Solutions based on them. The constrain here is that we cannot edit them free as we need. The Managed Property “Filetype” for example is filed by the system with the given value. So we have to use some “tricks” to build Search Driven Application with Office 365 / SharePoint Online.

My solution for this problem is using the tagging feature in SharePoint 2010. Within this feature we are able to tag any content with special and individual information that can later be used to aggregate it under this scope or in the mix with other tags / scopes. Using the feature: “Metadata Publishing -> Save metadata on this list as social tags” allowed us to force users to fill in metadata in keyword fields or set default values which will then be automatically published as a social tag.

Based on this there are several ways to build Search Driven Solutions. During this Blogpost series I will come closer to two of them.
Let’s have a look at the first easier and simple one:
There is a Crawled Property called SocialTagId that can now be used to query for a special tag and so it can be used to build a search driven webpart.
Example search query: SocialTagId:"6a…b-754b-480e-86e8-5a…ae"

This Managed Property can also be used with standard search syntax for building AND / OR queries and be mixed with other search terms.

Example: SocialTagId:"fb2d872a-8750-4913-bc23-b0b32252b489" OR SocialTagId:"25dee478-f426-4dc1-9d25-340e9ecce093" – shows any content which is tagged with one of the given tags behind this SocialTagID´s

Some points to attend:
-          The result is just the same you get when you navigate to the Tag Profile page for a special tag.
-          Benefit is that you can use the resultset coming from the search in a separate webpart und customize the style etc. in an easy way
-          We are not able to do a  fuzzy search within this
-          You have to find out the SocialTagId which depends to your tag. This is not really a problem. To do these navigate to the Tag Profile, select “To find content related to '%tag%' in search, please click here.” The result is a search with the Managed Property “SocialTagId” and the given ID for the selected tag:

To Customize those Search Result using SharePoint Designer and XSLT follow the steps described by Laura Rogers: LINK
Webcast with hands on system demos:
Summary: we can build search driven solutions based on the tagging feature in Office 365 / SharePoint Online. Within advanced Document Library and List features like “Metadata Publishing” we can increase the usability and the user experience for adding this kind of information.
To aggregate any content tagged with special tags we can use the Managed Property SocialTagId.
Next post I will show how we can aggregate content based on any different similar tags.

16 Kommentare:

  1. Hi
    We are planning to migrate our SharePoint intranet to Microsoft 365 and we are looking to implement an advance search tool that provide our users with ability to search all documents regardless of their access rights and the security restriction should be applied after the search results.
    I am wondering if you have any ideas or suggestions

    1. Hm, sounds interesting… create a resultwebpart that runs under a special user having read access to all documents. Clicking on a result should open a new window running under logged-on user context…

  2. Hi
    thanks for you reply.
    I am trying to create resultwebpart but there is no option to run under different users
    can you please let me know how to do it


    1. Hi,
      There is no option to configure that functionality by default. You have to realize this writing your own code… for example have a look here: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx

  3. Hi
    as per Microsoft RunWithElevatedPrivileges command is not available for sharepoint online. I am not sure if this is right


    1. Hi, sorry, you are right. I forgot that you talked about O365. Impersonation is not allow in Sandbox Solutions. So as a quick answer I think you had to design a solution based on client code like jquery or something with Silverlight which both can handle impersonation…

  4. Interesting Article. Hoping that you will continue posting an article having a useful information. Server lösungen Berlin

  5. Very good and Knowledgeable information
    I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article.
    There is more relative topics below :
    14 August as an Independence Day for Pakistan

  6. Great blog knowledgeable information it very effective for beginner .keep sharing more blogs.

    maark security assessment services in USA

  7. more appreciating blog! Great internet site! It looks extremely good! Maintain a good job!| you are rocking man…!

    digital marketing services in UK

  8. Great blog knowledgeable information it very effective for beginner .keep sharing more blogs.

    cleaning in Sweden

  9. I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article. it was awesome to read, thanks for sharing this great content to my vision.
    I appreciate your work. please keep sharing more updates.
    progressive recruitment services

  10. I would like to thank you for weiting fabulous information about office 365 keep posting articals like this it will hepls us . to know more about office 365 Office365 Online Training