Donnerstag, 19. Juli 2012

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


Part II: Deeper look what kind of properties and workarounds can be used within Office 365 / SharePoint Online to aggregate information based on the search engine.
As we see in Part I we have to use some tricks to build Search Driven Solution in Office 365 / SharePoint Online. Based on the content and the solutions in Part I we can build a Metadata & Taggs based Content-Browser. The idea behind is using a fixed query showing all the content in the index and then use the Tags & Metadata Refiner to filter and navigate.
The fixed query to show all the content is simply that one: %% or you use a fake query like that one:(IsDocument="True") OR (IsDocument="False") both show anything in the index.
Next Step is configuring the Refiner Panel to only show the Tags & Metadata. To do this we have to delete all the other refiner entries in the undelaying XML. (Webpart settings of the refiner webpart -> Refinement -> Filter Category Definition)

The result looks like this:

<FilterCategories>

<Category Title="Managed Metadata Columns" Description="Managed metadata of the documents" Type="Microsoft.Office.Server.Search.WebControls.TaxonomyFilterGenerator" MetadataThreshold="20" NumberOfFiltersToDisplay="20" MaxNumberOfFilters="20" ShowMoreLink="True" MappedProperty="ows_MetadataFacetInfo" MoreLinkText="show more" LessLinkText="show fewer" ShowCounts="Count"/>

<Category Title="Tags" Description="All managed metadata of the documents and social tags" Type="Microsoft.Office.Server.Search.WebControls.TaxonomyFilterGenerator" MetadataThreshold="20" NumberOfFiltersToDisplay="20" MaxNumberOfFilters="20" ShowMoreLink="True" MappedProperty="ows_MetadataFacetInfo,popularsocialtags" MoreLinkText="show more" LessLinkText="show fewer" ShowCounts="Count"/>

</FilterCategories>


You can see, that I raised the values for MetadataThreshold, NumberOfFiltersToDisplay MaxNumberOfFilters up to 20 and ad the ShowCounts element to the XML.

And here the result:

This is of cause not looking really nice. But it shows which data is available out of the box. For example: Based on the property ows_MetadataFacetInfo and popularsocialtags in combination with the property Count you can easy develop a TagCloud Webpart.

Necessary points here are: using this to excessive will falsify you search ranking etc. Another problem is the performance of this solution. By default only the first 50 items in the index are used to generate the entries in the Refiner (Webpart settings of the refiner webpart -> Refinement -> Accuracy Index). Setting this value up to high you get a poor performance during loading the side. Is the value to low the risk is higher that some Tags ore Managed Metadata values are missing. Before we come to a new point lets me says that this is not really a SearchDriven Solution because what we do is searching for all in the index and then filter it, but for the end-user this wouldn’t make an difference ;-)

The main focus is almost to build solution which are user-friendly and which do not raise up the doings for users. So let’s now have a look at useful properties which are created by the system itself.

As we see in the XML of the Refiner there are two interesting search property: ows_MetadataFacetInfo and popularsocialtags. We can combine those properties to build SearchDriven Applications based on a SearchQueryString as described here: LINK (on this site you also can find a C# code sample for using this stuff developing own WebParts)

For example I will have a SearchQueryString (for my environment of cause) showing me all content tagged with “Tag2” and the taxonomy filed “Region” is “Bern”

https://..../NB/Search/results.aspx?k=%25%25&r=%22owstaxIdRegion%22%3D%23511b3749%2D7ca3%2D4011%2D90d0%2Df88a8bc5fb50%3A%22Bern%22%20socialtagId%3D25dee478%2Df426%2D4dc1%2D9d25%2D340e9ecce093

Let’s disassemble this:

Query fragment
Clear text
meaning
k=%25%25
%%
Search for all in the index
r=%22owstaxIdRegion%22%
R=”owstaxIdRegion”
The managed property the system created from the taxonomy field
%20socialtagId

%blank%socialtagID
The given tag “Tag2”

(SharePoint creates for every Managed Metadata filed crawled properties and managed properties as described here: LINK)

You can use this SearchQueryString now in a SearchResult Webpart or as a fixed link to provide information coming from all crawled content in your Office 365 / SharePoint Online filtered on: “Tag2” is given and Region is “Bern”.

This technique also works similar in the new Office 365 / SharePoint 2013 preview version. The SearchQueryString syntax will be a litte bit diferent, but the idea behind is similar. Of cause with the new versions of Office 365 and SharePoint we have much more options and opportunities. This will be part of the next session. ;-)

In addition there are some very interesting 3th party tools for navigation and aggregating content based on Metadata which also work with Office 365 / SharePoint Online. For Example this one: http://www.metaengine.com/sptermcloud
For me the main handicap on this solution is that it only works with taxonomy fields. If you want to work with external data coming from BCS sources, Azure etc. you need to use the tagging feature because Managed Metadata isn’t available for external data.
Next part of the series we will have a look at SearchDriven Applications with the new Office 365 / SharePoint 2013 preview version…
Webcast with hands on system demos:

Keine Kommentare:

Kommentar veröffentlichen