<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Search Nuggets &#187; jquery</title>
	<atom:link href="http://blog.comperiosearch.com/blog/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.comperiosearch.com</link>
	<description>A blog about Search as THE solution</description>
	<lastBuildDate>Mon, 13 Jun 2016 08:59:45 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>Introducing Solrstrap: A blazing fast tool for querying Solr in a Googleish fashion</title>
		<link>http://blog.comperiosearch.com/blog/2013/02/17/introducing-solrstrap/</link>
		<comments>http://blog.comperiosearch.com/blog/2013/02/17/introducing-solrstrap/#comments</comments>
		<pubDate>Sun, 17 Feb 2013 10:21:31 +0000</pubDate>
		<dc:creator><![CDATA[Fergus McDowall]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Solr]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=1235</guid>
		<description><![CDATA[I have just made the first (unnumbered) release of Solrstrap available on github http://fergiemcdowall.github.com/solrstrap/ Solrstrap is a Query-Result interface for Solr- it is intended to be a starting point for those building web interfaces that talk to Solr, or a very lightweight admin tool for querying Solr in a Googleish fashion. Cool things about Solrstrap: [...]]]></description>
				<content:encoded><![CDATA[<p>I have just made the first (unnumbered) release of Solrstrap available on github <a href="http://fergiemcdowall.github.com/solrstrap/">http://fergiemcdowall.github.com/solrstrap/</a></p>
<p>Solrstrap is a Query-Result interface for Solr- it is intended to be a starting point for those building web interfaces that talk to Solr, or a very lightweight admin tool for querying Solr in a Googleish fashion.</p>
<p>Cool things about Solrstrap:</p>
<ul>
<li>Requires <em>only</em> local installation- easy to set up</li>
<li>Access to all Bootstrap functionality. Can be easily extended in a Bootstrappy way.</li>
<li>Blazing fast</li>
<li>Uses less bandwidth</li>
</ul>
<p>Use it as you see fit. Merciless criticism and fawning praise equally welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2013/02/17/introducing-solrstrap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Handlebars.js To Display Results From Solr- A Primer</title>
		<link>http://blog.comperiosearch.com/blog/2012/09/07/using-handlebars-js-to-display-results-from-solr-a-primer/</link>
		<comments>http://blog.comperiosearch.com/blog/2012/09/07/using-handlebars-js-to-display-results-from-solr-a-primer/#comments</comments>
		<pubDate>Fri, 07 Sep 2012 09:12:03 +0000</pubDate>
		<dc:creator><![CDATA[Fergus McDowall]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[handlebars]]></category>
		<category><![CDATA[handlebars.js]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Solr]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=1110</guid>
		<description><![CDATA[Handlebars.js is a really great way to render search results from Solr. Handlebars.js has become the defacto standard for templating in JavaScript, filling the void left from the abandonment and non-replacement of the jQuery template project. Handlebars.js is an implementation of the mighty platform-independant mustache project JavaScript templating makes it a lot easier to implement [...]]]></description>
				<content:encoded><![CDATA[<p><div id="attachment_1132" style="width: 366px" class="wp-caption alignleft"><a href="http://blog.comperiosearch.com/wp-content/uploads/2012/09/handlebars_logo.png"><img src="http://blog.comperiosearch.com/wp-content/uploads/2012/09/handlebars_logo.png" alt="" title="handlebars_logo" width="356" height="218" class="size-full wp-image-1132" /></a><p class="wp-caption-text">Handlebars provides the power necessary to let you build semantic templates effectively with no frustration.</p></div>Handlebars.js is a really great way to render search results from <a href="http://lucene.apache.org/solr/">Solr</a>.</p>
<p>Handlebars.js has become the defacto standard for templating in JavaScript, filling the void left from the abandonment and non-replacement of the jQuery template project. Handlebars.js is an implementation of <a href="http://mustache.github.com/">the mighty platform-independant mustache project</a></p>
<p>JavaScript templating makes it a lot easier to implement cool interface functionality on your search result page such as responsive design, autoscrolling and more. Handlebars make JS templating a cinch.</p>
<p>You get the benefit of Handlebars.js on webpages that have a lot of repeating code such as lists, search-results and libraries.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2012/09/solr-handlebars-demo.html">In order to see Solr and Handlebars.js in action click here</a> or copy and paste the code below into an empty .html file.</p>
<p></p><pre class="crayon-plain-tag">&lt;b&gt;Handlebars.js and Solr Demo&lt;/b&gt;&lt;br&gt;
Type in something reutersey and click the &lt;b&gt;search&lt;/b&gt; button!&lt;br&gt;
&lt;input id=&quot;searchterm&quot; /&gt;
&lt;button id=&quot;search&quot;&gt;search&lt;/button&gt;
&lt;div id=&quot;rs&quot;&gt;&lt;/div&gt;
&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0.beta6/handlebars.min.js&quot;&gt;&lt;/script&gt;
&lt;script id=&quot;hit-template&quot; type=&quot;text/x-handlebars-template&quot;&gt;
  &lt;div class=&quot;entry&quot;&gt;
    &lt;b&gt;{{title}}&lt;/b&gt;&lt;br&gt;
    {{text}}
  &lt;/div&gt;
&lt;/script&gt;
&lt;script type='text/javascript'&gt;
  var hitTemplate = Handlebars.compile($(&quot;#hit-template&quot;).html());
  $(&quot;#search&quot;).click(function(){
    $(&quot;#rs&quot;).empty();
    $.getJSON(&quot;http://evolvingweb.ca/solr/reuters/select/?q=&quot; + $(&quot;#searchterm&quot;).val() + &quot;&amp;wt=json&amp;json.wrf=?&amp;indent=true&quot;, function(result){
      for (var i = 0; i &lt; result.response.docs.length; i++) {
        $(&quot;#rs&quot;).append(hitTemplate({title: result.response.docs[i].title, text: result.response.docs[i].text}));
      }
    });
  });
&lt;/script&gt;</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2012/09/07/using-handlebars-js-to-display-results-from-solr-a-primer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Solr and Javascript Templating (Solr meetup presentation, September 2012)</title>
		<link>http://blog.comperiosearch.com/blog/2012/09/05/solr-and-javascript-templating-solr-meetup-presentation-september-2012/</link>
		<comments>http://blog.comperiosearch.com/blog/2012/09/05/solr-and-javascript-templating-solr-meetup-presentation-september-2012/#comments</comments>
		<pubDate>Wed, 05 Sep 2012 07:07:06 +0000</pubDate>
		<dc:creator><![CDATA[Fergus McDowall]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Solr]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=1098</guid>
		<description><![CDATA[Here is a copy of the short presentation I gave at the Solr meetup on the 4th September 2012. Read it if you want a really high level view of the cost, performance, and functional benefits of using Javascript templates to create search applications. One of the live demos has also been uploaded here to [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2012/09/meetup.pdf" target="_blank">Here is a copy of the short presentation I gave at the Solr meetup on the 4th September 2012</a>. Read it if you want a really high level view of the cost, performance, and functional benefits of using Javascript templates to create search applications.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2012/09/solr.html" title="here" target="_blank">One of the live demos has also been uploaded here</a> to demonstrate how a Solr server can be rendered using JavaScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2012/09/05/solr-and-javascript-templating-solr-meetup-presentation-september-2012/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Make an &#8220;instant search&#8221; application using JSON, Ajax and JQuery</title>
		<link>http://blog.comperiosearch.com/blog/2012/06/27/make-an-instant-search-application-using-json-ajax-and-jquery/</link>
		<comments>http://blog.comperiosearch.com/blog/2012/06/27/make-an-instant-search-application-using-json-ajax-and-jquery/#comments</comments>
		<pubDate>Wed, 27 Jun 2012 10:41:15 +0000</pubDate>
		<dc:creator><![CDATA[Fergus McDowall]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[OpenSearch]]></category>
		<category><![CDATA[Wikipedia]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=975</guid>
		<description><![CDATA[Update 20th Feb 2013: Instant search is now implemented on Solrstrap, the lightweight Solr interface written in JavaScript, HTML and CSS. Check it out here. Here is a quick demo that demonstrates how to create an &#8220;instant search&#8221; service using JSON, ajax and JQuery. This instant search application uses the excellent OpenSearch interface provided by [...]]]></description>
				<content:encoded><![CDATA[<p><em><strong>Update 20th Feb 2013:</strong> Instant search is now implemented on <a href="http://blog.comperiosearch.com/blog/2013/02/17/introducing-solrstrap/" title="Introducing Solrstrap: A blazing fast tool for querying Solr in a Googleish fashion">Solrstrap</a>, the lightweight Solr interface written in JavaScript, HTML and CSS. <a href="http://blog.comperiosearch.com/blog/2013/02/17/introducing-solrstrap/" title="Introducing Solrstrap: A blazing fast tool for querying Solr in a Googleish fashion">Check it out here</a></em>.</p>
<p>Here is a quick demo that demonstrates how to create an &#8220;instant search&#8221; service using JSON, ajax and JQuery. This instant search application uses the excellent OpenSearch interface provided by Wikipedia. Use this code as a starting point for developing prettier result pages.</p>
<p>The Wikipedia query API is described in some detail <a href="http://www.mediawiki.org/wiki/API:Main_page" target="_blank">here</a>.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2012/06/instantsearch.html">Click here to see the demo</a>, or copy and paste the code below into a blank HTML document.</p><pre class="crayon-plain-tag">&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt;</pre><p></p>
<h1>Search Wikipedia!</h1>
<p></p><pre class="crayon-plain-tag">&lt;input id=&quot;searchterm&quot; type=&quot;text&quot; /&gt; &lt;button id=&quot;search&quot;&gt;search&lt;/button&gt;</pre><p></p>
<div id="results"></div>
<p></p><pre class="crayon-plain-tag">&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
      $(&quot;#searchterm&quot;).keyup(function(e){
        var q = $(&quot;#searchterm&quot;).val();
        $.getJSON(&quot;http://en.wikipedia.org/w/api.php?callback=?&quot;,
        {
          srsearch: q,
          action: &quot;query&quot;,
          list: &quot;search&quot;,
          format: &quot;json&quot;
        },
        function(data) {
          $(&quot;#results&quot;).empty();
          $(&quot;#results&quot;).append(&quot;

Results for &lt;b&gt;&quot; + q + &quot;&lt;/b&gt;

&quot;);
          $.each(data.query.search, function(i,item){
            $(&quot;#results&quot;).append(&quot;
&lt;div&gt;&lt;a href='http://en.wikipedia.org/wiki/&quot; + encodeURIComponent(item.title) + &quot;'&gt;&quot; + item.title + &quot;&lt;/a&gt;&quot; + item.snippet + &quot;&lt;/div&gt;
&quot;);
          });
        });
      });

// ]]&gt;&lt;/script&gt;</pre><p></p>
<div style="position: absolute; bottom: 0; right: 0; text-align: right;"><a href="http://blog.comperiosearch.com/author/fmcdowall/">Fergus McDowall</a> 2012</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2012/06/27/make-an-instant-search-application-using-json-ajax-and-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Super Fast Image Search with JSON, JQuery and Flickr</title>
		<link>http://blog.comperiosearch.com/blog/2012/03/14/super-simple-image-search-json-jquery-flickr/</link>
		<comments>http://blog.comperiosearch.com/blog/2012/03/14/super-simple-image-search-json-jquery-flickr/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 11:36:02 +0000</pubDate>
		<dc:creator><![CDATA[Fergus McDowall]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[image search]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/?p=860</guid>
		<description><![CDATA[Here is a way to build up a really simple image search application using HTML, CSS and JQuery. One thing that can be improved about most image search apps is that browsing search history is sloooow. This image search app provides a neat solution to the history/speed issue by simply displaying results in a push-pop [...]]]></description>
				<content:encoded><![CDATA[<p>Here is a way to build up a really simple image search application using HTML, CSS and JQuery. One thing that <a href="http://therealfirstworldproblems.tumblr.com/">can be improved</a> about most image search apps is that browsing search history is sloooow.</p>
<p>This image search app provides a neat solution to the history/speed issue by simply displaying results in a <em>push-pop</em> stack. As you type in new search terms, the image thumbnails are prepended to the resultset. Your search history stays on the page, but is simply pushed further down as new thumbnails appear. Its is really fast and simple to browse your image search history.</p>
<p>Also, this search app operates entirely in 30 lines of HTML and JavaScript by using a JSON feed to the flickr API. Simple and elegant.</p>
<p><a href='http://blog.comperiosearch.com/wp-content/uploads/2012/03/super-simple-image-search.html'>Click here for the demo</a></p>
<p>Or copy and paste the code below this line:</p><pre class="crayon-plain-tag">&lt;html&gt;
  &lt;head&gt;
    &lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt;
    &lt;title&gt;Comperio Super Simple Image Search&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    Search for &lt;b&gt;cats, dogs, cakes&lt;/b&gt;, or anything else that takes your fancy :-)
    &lt;br /&gt;
    &lt;input id=&quot;searchterm&quot; /&gt;
    &lt;button id=&quot;search&quot;&gt;search&lt;/button&gt;
    &lt;div id=&quot;results&quot;&gt;&lt;/div&gt;
    &lt;script&gt;
      $(&quot;#search&quot;).click(function(){
        $.getJSON(&quot;http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?&quot;,
        {
          tags: $(&quot;#searchterm&quot;).val(),
          tagmode: &quot;any&quot;,
          format: &quot;json&quot;
        },
        function(data) {
          $.each(data.items, function(i,item){
            $(&quot;&lt;img/&gt;&quot;).attr(&quot;src&quot;, item.media.m).prependTo(&quot;#results&quot;);
            if ( i == 10 ) return false;
          });
        });
      });
    &lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2012/03/14/super-simple-image-search-json-jquery-flickr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asynchronous search results with JQuery, Solr, Json and Ajax</title>
		<link>http://blog.comperiosearch.com/blog/2011/03/31/asynchronous-search-results-jquery-solr-json-ajax/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/03/31/asynchronous-search-results-jquery-solr-json-ajax/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 13:52:40 +0000</pubDate>
		<dc:creator><![CDATA[Fergus McDowall]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[Solr]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/?p=369</guid>
		<description><![CDATA[Update: Aug 5th 2012 A live demo of asynchronous search results with JQuery, Solr, Json and Ajax can now be found here There are many reasons to load search results asynchronously- most of the big searchy dotcoms are going in this direction with Google, Facebook and Twitter all relying heavily on ajax to render their [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/03/solr.jpg"><img src="http://blog.comperiosearch.com/wp-content/uploads/2011/03/solr.jpg" alt="Solr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project" title="Solr Logo" width="283" height="156" class="alignleft size-full wp-image-376" /></a></p>
<p><strong>Update: Aug 5th 2012</strong><a href="http://blog.comperiosearch.com/wp-content/uploads/2012/09/solr.html"> A live demo of asynchronous search results with JQuery, Solr, Json and Ajax can now be found here</a></p>
<p>There are many reasons to load search results asynchronously- most of the big searchy dotcoms are going in this direction with Google, Facebook and Twitter all relying heavily on <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">ajax</a> to render their feed-based pages.</p>
<p>Considering how mainstream it has become, information on the nuts and bolts of the technique remain thin on the ground. So here is a really quick overview of what you need to get started.</p>
<p>For the purposes of this post I will assume that you have an working installation of <a href="http://lucene.apache.org/solr/">Solr</a> in a more or less standard configuration. Getting Solr up and running is no mean feat in itself, but mercifully there are a number of fairly decent guides squirreled away on the internet. You could of course use any search motor that returns search results in a Json format, in fact even if they dont, <a href="http://www.comperiosearch.com/products/comperio-front/">Comperio Front</a> can now be used to provide a <a href="http://www.json.org/">JSON</a> query service on any (collection of) search motor(s).</p>
<p>So lets assume that a query for &#8220;Ford&#8221; returns Json in the following format from our very small index of cars. Note that the Solr URL for this feed would look something like this: http://localhost:8080/solr/select/?q=ford&amp;wt=json&amp;json.wrf=?&amp;indent=true where wt specifies json and json.wrf specifies the <a href="http://stackoverflow.com/questions/483073/getting-a-better-understanding-of-callback-functions-in-javascript">callback</a></p><pre class="crayon-plain-tag">({
  &quot;responseHeader&quot;:{
    &quot;status&quot;:0,
    &quot;QTime&quot;:1,
    &quot;params&quot;:{
      &quot;json.wrf&quot;:&quot;?&quot;,
      &quot;indent&quot;:&quot;true&quot;,
      &quot;q&quot;:&quot;ford&quot;,
      &quot;wt&quot;:&quot;json&quot;}},
  &quot;response&quot;:{&quot;numFound&quot;:3,&quot;start&quot;:0,&quot;docs&quot;:[
      {
        &quot;id&quot;:&quot;147&quot;,
        &quot;name&quot;:&quot;Ford Capri&quot;,
        &quot;description&quot;:&quot;pink 1978 model- great condition&quot;,
        &quot;owner&quot;:&quot;576463865&quot;,
        &quot;store&quot;:&quot;59.7440738,10.204456400000026&quot;,
        &quot;tags&quot;:[
          &quot;Ford, Capri, Pink, 1978&quot;]},
      {
        &quot;id&quot;:&quot;148&quot;,
        &quot;name&quot;:&quot;Ford Orion&quot;,
        &quot;description&quot;:&quot;Blue, Good runner&quot;,
        &quot;owner&quot;:&quot;576463865&quot;,
        &quot;store&quot;:&quot;59.9138688,10.752245399999993&quot;,
        &quot;tags&quot;:[
          &quot;blue, orion, 1.6&quot;]},
      {
        &quot;id&quot;:&quot;149&quot;,
        &quot;name&quot;:&quot;Ford Anglia&quot;,
        &quot;description&quot;:&quot;As seen in Harry Potter, Can be flown&quot;,
        &quot;owner&quot;:&quot;576463865&quot;,
        &quot;store&quot;:&quot;57.2366283,-2.2650615999999673&quot;,
        &quot;tags&quot;:[
          &quot;Harry Potter, Anglia, Flying car&quot;]}
    ]
  }
})</pre><p></p>
<p>We can now parse this feed by using the .getJSON function in the excellent jQuery library. The javascript and associated HTML would be more or less like so:</p><pre class="crayon-plain-tag">&lt;div id=&quot;rs&quot;&gt;&lt;/div&gt;
  &lt;script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js'&gt;&lt;/script&gt;
  &lt;script type='text/javascript'&gt;
    $.getJSON(&quot;http://localhost:8080/solr/select/?q=ford&amp;wt=json&amp;json.wrf=?&amp;indent=true&quot;, function(result){
    var Parent = document.getElementById('rs');
    for (var i = 0; i &lt; result.response.docs.length; i++) {
      var thisResult = &quot;&lt;b&gt;&quot; + result.response.docs[i].name + &quot;&lt;/b&gt;&lt;br&gt;&quot; + result.response.docs[i].description
      + &quot;, &quot; + result.response.docs[i].tags + &quot;&lt;br&gt;&quot;;
      var NewDiv = document.createElement(&quot;DIV&quot;);
      NewDiv.innerHTML = thisResult;
      Parent.appendChild(NewDiv);
    }
  });
&lt;/script&gt;</pre><p>And thats it :-) You will notice that when the HTML above is loaded in a browser, that the search results are returned independently of the webpage.</p>
<p><strong>Next Steps:</strong> <a href="http://blog.comperiosearch.com/2012/09/using-handlebars-js-to-display-results-from-solr-a-primer/" title="Using Handlebars.js To Display Results From Solr- A Primer">Use JavaScript templating to render results from Solr</a></p>
<a href="http://blog.comperiosearch.com/wp-content/uploads/2011/03/solr.jpg"><img src="http://blog.comperiosearch.com/wp-content/uploads/2011/03/solr.jpg" alt="Solr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project" title="Solr Logo" width="283" height="156" class="size-full wp-image-376" /></a>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/03/31/asynchronous-search-results-jquery-solr-json-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Doing blended results in SharePoint &#8211; Part 1: The Hackish Way</title>
		<link>http://blog.comperiosearch.com/blog/2010/12/08/doing-blended-results-in-sharepointpart-1-the-hackish-way/</link>
		<comments>http://blog.comperiosearch.com/blog/2010/12/08/doing-blended-results-in-sharepointpart-1-the-hackish-way/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 19:54:00 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2010/12/doing-blended-results-in-sharepointpart-1-the-hackish-way/</guid>
		<description><![CDATA[(This post is cross posted from Tech and Me) A comment from a colleague on my previous blog post, “XSLT creation revisited for SharePoint 2010 Search and a small search tip”, asked how I would do blended search results in SharePoint Search. I have come up with three ways of doing this, where I will [...]]]></description>
				<content:encoded><![CDATA[<p><em>(This post is cross posted from </em><a href="http://techmikael.blogspot.com/2010/12/doing-blended-results-in-sharepointpart.html" target="_blank"><em>Tech and Me</em></a><em>)</em></p>
<p>A comment from a colleague on my previous blog post, “<a href="http://techmikael.blogspot.com/2010/11/xslt-creation-revisited-for-sharepoint.html" target="_blank">XSLT creation revisited for SharePoint 2010 Search and a small search tip</a>”, asked how I would do blended search results in SharePoint Search. I have come up with three ways of doing this, where I will demonstrate the quick and dirty one in this post, and save the “best architectural” version for last. So watch out for part 2 and 3 of this topic in the weeks to come.</p>
<p>The method described in this post is suitable for non-developers.</p>
<p>For those who don’t know what “blended search results” is, it is search results from a different source merged into your regular results. On Bing and Google you often see news in addition to images and videos blended with the regular web hits. The method is used to keep apples from oranges, (or fruit cakes from gingerbread men in these x-mas times), so the end-user can more easily digest the search result.</p>
<p>In the image below, Bing has inserted image hits between hit #3 and #4 of the web results.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2010/12/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2010/12/image_thumb.png" border="0" alt="image" width="589" height="800" /></a></p>
<p>For this example the main content will be crawled content from <a href="http://www.comperiosearch.com">http://www.comperiosearch.com</a> and the blended content will be web content from Bing.</p>
<p>On your search center page drop in a new Core Results Web Part into the right hand column and name it for example “News Results”. SharePoint already have a Search Location for “Internet Search Results” defined so we will use this. This is an Open Search definition and you can also create and upload your own towards other Open Search providers. You find this under “Federated Locations” on your Search Query SSA in Central Admin. We will limit the results to 3 items.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2010/12/image1.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2010/12/image_thumb1.png" border="0" alt="image" width="509" height="782" /></a></p>
<p>The next step is to modify the XSL of the web part. Uncheck “Use Location Visualization” and click the “XSL Editor…”</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2010/12/image2.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2010/12/image_thumb2.png" border="0" alt="image" width="255" height="511" /></a></p>
<p>Locate &lt;xsl:template name=&#8221;MainTemplate&#8221; &gt; inside the xsl and append the following xsl after the line &lt;div class=&#8221;srch-results&#8221; &gt;</p><pre class="crayon-plain-tag">&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:text&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;disable-output-escaping&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;yes&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;!&lt;/span&gt;[CDATA[
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://code.jquery.com/jquery-1.4.4.min.js&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;script type=&lt;span class=&quot;str&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&amp;gt;
    $( &lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt;()
    {
        &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; news = $(&lt;span class=&quot;str&quot;&gt;&quot;.srch-federationarea .srch-results .ms-searchsummarybody&quot;&lt;/span&gt;);
        news.css( &lt;span class=&quot;str&quot;&gt;&quot;margin-left&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;20px&quot;&lt;/span&gt;);
        news.css( &lt;span class=&quot;str&quot;&gt;&quot;background-color&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;#ccc&quot;&lt;/span&gt;);
        $(&lt;span class=&quot;str&quot;&gt;&quot;.srch-maintop2 .srch-results div:first&quot;&lt;/span&gt;).next().next().after( news );
    } );
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
]]&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;</pre><p>This will link in jQuery from a CDN repository, and once the page is loaded the news search in the right column is moved with jQuery from the right column to after the third hit in the standard core results web part. The content is indented by 20 pixels, and the background is set to gray like seen on the image below.</p>
<p>(If you have fewer than three main results you need to modify the code for it to work)</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2010/12/image3.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2010/12/image_thumb3.png" border="0" alt="image" width="728" height="780" /></a><br />
<!--.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>In order for this to look better I would either need to do more jQuery magic, or change the xsl of the news results so that it renders it properly.</p>
<p>With an extra web part and a few lines added to an xslt, we have achieved blended results.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2010/12/08/doing-blended-results-in-sharepointpart-1-the-hackish-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
