As you may be aware or not as the case may be, the Content Query Web Part as we know has been updated a little. We have also been given a new web part called Content Search that allows for search to be used for the aggregation, kind of what we used to do by using the core results web parts with fixed queries.
To see what changes have been made, first we need to go to our SharePoint Site, mine is a Publishing Site. From within the site, edit the page and select to add a web part. You will then select the "Content Rollup > Content Query" option.
This will then add this to the page as shown below:
To configure it is almost the same as before except there is now a hint as to another way of filtering the results:
You can now filter the content results by the page navigation term. So what does that mean, well if we now jump over to the term store we all love to hate, you will see some new options that this relates too.
Yes you can now create your site navigation directly within the term store and use that within your sites, fantastic for Public Facing sites, or even some great customization here using code. To add a node it is the same as it always was except we now have an "Intended Use" tab that defines what the term set is to be used for.
So what is the use case, well-structured term sets, defined as navigation elements, content query web part added for aggregation, refined by the actual navigation term that is currently selected, future post to come.
So back to the new web part called the "Content Search", this is the web part you will use to aggregate content from across site collections. This uses the search mechanism for this, which is great as it is fast and updates automatically. To use this web part add it from the same category and it should display as shown below:
To configure it, edit the web part and you will see a large button called "Change Query", press that.
Once clicked it should load a dialog where you are able to configure the query.
This is fantastic, you are able to see where the data comes from, restrict t by tags, sort the results and then modify the refiners, settings and even test it with a preview to the results. Obviously the results only work if you have actually crawled the site, NO CAML to be seen here J
This is fantastic as it allows for a highly customized query and result set to be returned, as well as a allowing for great customization using templates and of course XSLT. The key to making it work well is to configure the results within search, so the current ones are:
You can create your own and use them directly in the web part. You can do this by accessing the following URL in Central Administration (you need to do this within the search application, click the "Results Sources" link)
You will also need to ensure that you have set the query boundary for the results.
This is where we can perform cross site collection aggregation by not restricting the URL.
If we switch the query builder to advanced mode, then we really have great control over what is used.
I really really like this web part, a great addition to the aggregation mechanism of SharePoint. As I have been a great advocate of harnessing SharePoint Search for years now it is great to now have to build a custom web part for this now J
Now the question that always comes up is when will the updated content display in the web part, well that is easy it is down to the crawl schedules, now with this web part you may want to increase the schedules or use the new feature of "Continuous" crawling, obviously performance implications should be resolved if you use this option. Within the content source in the search service application you can now set this option.
As you can see some great investments have been made so far in the aggregation framework for SharePoint 2013. More to come in future posts J