Monday 30 June 2014

Content search web part in the SharePoint 2013

Content search web part in the SharePoint 2013
The Content Search Web Part (CSWP) is a Web Part introduced in SharePoint 2013 that uses various styling options to display dynamic content on SharePoint pages.
Content Search Web Part displays search results in a way that you can easily format. Each Content Search Web Part is associated with a search query and shows the results for that search query.
You can use display templates to change how search results appear on the page. Display templates are snippets of HTML and JavaScript that render the information returned by SharePoint. The information to be displayed gets inserted into the page in JSON format.
CSWP: Content Search Web part and CQWP: Content Query Web part
The CSWP can return any content from the search index. Use it on your SharePoint 2013 sites when you are connecting to a search service and want to return indexed search results in your pages.
The CSWP returns content that is as fresh as the latest crawl of your content, so if you crawl often, the content that the CSWP returns is more up-to-date than if you crawl infrequently. If you need to display instant content or the refreshed version of content, use the Content Query Web Part (CQWP) instead.
Search crawls only the major versions of content, never the minor versions. If you want to display the minor versions of your content, do that by using a CQWP.
Some site collection administrators mark sites to not be indexed. Content marked in this way is not available in a CSWP. If you want to return results from a site that is marked to not index, use the CQWP instead.
Add a Content Search Web Part to a page
To add a Content Search Web Part to a page
  1. Verify that the user account that performs this procedure is a member of the Designers SharePoint group on the publishing site collection.
  2. Browse to the page where you want to add the Web Part.
  3. Click the Settings menu, and then click Edit page.
  4. In the Web Part Zone where you want to add the Web Part, click Add a Web Part.
  5. In the Categories list, click Content Rollup.
  6. In the Parts list, click Content Search, and then click Add.
Content search web part in the SharePoint 2013
Content Search Webpart Content Search Webpart[/caption]

SharePoint 2013 : Set Content Search Web Part “QueryText” Attribute Programmatically

http://blogs.msdn.com/b/davidrei/archive/2012/12/27/sharepoint-2013-set-content-search-web-part-querytext-attribute-programmatically.aspx