<?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; Murhaf Fares</title>
	<atom:link href="http://blog.comperiosearch.com/blog/author/murhaf/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>Bitbucket to Elasticsearch Connector</title>
		<link>http://blog.comperiosearch.com/blog/2014/09/18/bitbucket-elasticsearch-connector/</link>
		<comments>http://blog.comperiosearch.com/blog/2014/09/18/bitbucket-elasticsearch-connector/#comments</comments>
		<pubDate>Thu, 18 Sep 2014 11:46:16 +0000</pubDate>
		<dc:creator><![CDATA[Murhaf Fares]]></dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[bitbucket]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=2989</guid>
		<description><![CDATA[&#8220;Ability to search source code? (BB-39)&#8221; is an issue created in July 2011 on Bitbucket and its status is still new. If you have used Bitbucket before, you would have certainly noticed that there is no way to search in a repository&#8217;s source code. Now what if you had more than 200 repositories (as is [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright wp-image-3002 size-full" src="http://blog.comperiosearch.com/wp-content/uploads/2014/09/bitbucket-logo-a3719e03.png" alt="bitbucket-logo-a3719e03" width="248" height="248" /><br />
<em>&#8220;Ability to search source code? (BB-39)&#8221;</em> is an <a href="https://bitbucket.org/site/master/issue/2874/ability-to-search-source-code-bb-39" target="_blank">issue created in July 2011</a> on Bitbucket and its status is still new. If you have used Bitbucket before, you would have certainly noticed that there is no way to search in a repository&#8217;s source code. Now what if you had more than 200 repositories (as is the case for Comperio) and you wanted to search for some examples on how to use a function, for example? There are two options. Either clone all the repos to your local machine and then do some &#8216;grep&#8217; magic or use our connector to index Bitbucket content in elasticsearch and then search happily ever after.</p>
<p>In this blog post, we introduce an <a href="https://github.com/comperiosearch/bitbucket-elasticsearch-connector" target="_blank">open-source and free connector</a> that indexes content from Bitbucket in elasticsearch. The connector is written in Python and it has two main modes: <em>index</em>, indexes everything from your Bitbucket account in elasticsearch, and <em>update</em>, updates your elasticsearch index based on the commits from the last time your ran the connector (there are three types of git update: add, change and delete).<br />
The connector creates an elasticsearch index (based on the configurations provided in <a href="https://github.com/comperiosearch/bitbucket-elasticsearch-connector/blob/master/elasticsearch.conf" target="_blank">elasticsearch.conf</a>) which in turn has two types of documents, namely &#8216;file&#8217; and &#8216;repo&#8217;. We only provide a <a href="https://github.com/comperiosearch/bitbucket-elasticsearch-connector/blob/master/file_mapping.json" target="_blank">mapping file</a> for the &#8216;file-typed&#8217; documents, you can create one for repos as well. For information on the connector and how to use it, please see the <a href="https://github.com/comperiosearch/bitbucket-elasticsearch-connector" target="_blank">project&#8217;s page</a> on GitHub.</p>
<p><strong>Bitbucket REST APIs</strong><br />
If you check the source code of the connector, you will see that we are using two versions of Bitbucket REST APIs (<a href="https://confluence.atlassian.com/display/BITBUCKET/Version+1" target="_blank">version 1.0</a> and <a href="https://confluence.atlassian.com/display/BITBUCKET/Version+2" target="_blank">version 2.0</a>). We are doing so because not everything supported by version 1.0 is supported by version 2.0 and vice versa, e.g. branches are retrievable in API V 1.0 but not 2.0.</p>
<p><strong>Field collapsing for duplicates from different branches</strong><br />
If a repo has more than one branch, the connector would index the files in all branches as separate documents. This means that whenever you are searching for something, you will see the same matching file from the different branches as separate hits as well. In order to avoid this, we created an ID called <em>collapse_id</em> which allows us to collapse hits of the same file, but from different branches, using queries similar to the following:<br />
<script src="https://gist.github.com/d26cc5a1c0b570de85b8.js?file=collapsing-with-top-hits-agg.json"></script><br />
See another example of field collapsing using the top hits aggregation <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html#_field_collapse_example" target="_blank">on elasticsearch.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2014/09/18/bitbucket-elasticsearch-connector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ELK in one (Vagrant) box</title>
		<link>http://blog.comperiosearch.com/blog/2014/08/14/elk-one-vagrant-box/</link>
		<comments>http://blog.comperiosearch.com/blog/2014/08/14/elk-one-vagrant-box/#comments</comments>
		<pubDate>Thu, 14 Aug 2014 14:06:18 +0000</pubDate>
		<dc:creator><![CDATA[Murhaf Fares]]></dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[elk]]></category>
		<category><![CDATA[Kibana]]></category>
		<category><![CDATA[logstash]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[vagrant]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=2813</guid>
		<description><![CDATA[In this blog post we introduce a Vagrant box to easily create configurable and reproducible development environments for ELK (Elasticsearch, Logastash and Kibana). At Comperio, we mainly use this box for query log analysis using the ELK stack. In case you don’t know, Vagrant is a free and open-source software that combines VirtualBox (a virtualization [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-2828" src="http://blog.comperiosearch.com/wp-content/uploads/2014/08/elk_vagrant_chilling1-300x300.png" alt="elk_vagrant_chilling" width="300" height="300" /></p>
<p>In this blog post we introduce a Vagrant box to easily create configurable and reproducible development environments for ELK (Elasticsearch, Logastash and Kibana). At Comperio, we mainly use this box for query log analysis using the ELK stack.<br />
In case you don’t know, <a href="http://www.vagrantup.com/">Vagrant</a> is a free and open-source software that combines VirtualBox (a virtualization software) with configuration management softwares such as Puppet and Chef.</p>
<p><strong>ELK stack up and running in two commands</strong></p>
<blockquote><p>$ git clone https://github.com/comperiosearch/vagrant-elk-box.git<br />
$ vagrant up</p></blockquote>
<p>By cloning this <a href="https://github.com/comperiosearch/vagrant-elk-box">github repo</a> and then typing “vagrant up”, you will be installing elasticsearch, logstash, kibana and nginx (the latter used to serve kibana).</p>
<p>Elasticsearch will be running on port 9200, as usual, which is forwarded to the host machine. As for Kibana, it will be served on port 5601 (also accessible from the host OS).</p>
<p><strong>How does it work?</strong><br />
As mentioned above, Vagrant is a wrapper around VirtualBox and some configuration management software. In our box, we use pure shell scripting and Puppet to configure the ELK stack.<br />
There are two essential configuration files in this box: <a href="https://github.com/comperiosearch/vagrant-elk-box/blob/master/Vagrantfile">Vagrantfile</a> and the Puppet manifest <a href="https://github.com/comperiosearch/vagrant-elk-box/blob/master/manifests/default.pp">default.pp</a>.<br />
Vagrantfile includes the settings of the virtual box such as operating system, memory size, number of CPUs, forwarded ports, etc…<br />
<script src="https://gist.github.com/0ba6fa7ecece4fdac1ff.js?file=Vagrantfile"></script></p>
<p>Vagrantfile also includes a shell script that installs, among other things, the official Puppet modules for <a href="https://github.com/elasticsearch/puppet-elasticsearch">elasticsearch</a> and <a href="https://github.com/elasticsearch/puppet-logstash">logstash</a>. By using that shell script we stay away from git submodules which were used in <a href="https://github.com/comperiosearch/vagrant-elasticsearch-box">another Vagrant image</a> we made earlier for elasticsearch.<br />
<script src="https://gist.github.com/fb50e0cfcdee2e14898a.js?file=Vagrantfile"></script></p>
<p>In the Puppet manifest, default.pp, we define what version of elasticsearch to install and make sure that it is running as a service.<br />
<script src="https://gist.github.com/3abbe1b3aee8ecbe1b9e.js?file=default.pp"></script></p>
<p>We do the same for logstash and additionally link the default logstash configuration file to <a href="https://github.com/comperiosearch/vagrant-elk-box/blob/master/confs/logstash/logstash.conf">this file</a> under /Vagrant/confs/logstash which is shared with the host OS. Finally, we install nginx and Kibana, and configure Kibana to run on port 5601 (by linking the nginx conf file to <a href="https://github.com/comperiosearch/vagrant-elk-box/blob/master/confs/nginx/default">this file</a> in the Vagrant directory also).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2014/08/14/elk-one-vagrant-box/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Bygger søkesystemer for næringslivet</title>
		<link>http://blog.comperiosearch.com/blog/2014/08/14/bygger-sokesystemer-naeringslivet/</link>
		<comments>http://blog.comperiosearch.com/blog/2014/08/14/bygger-sokesystemer-naeringslivet/#comments</comments>
		<pubDate>Thu, 14 Aug 2014 11:35:07 +0000</pubDate>
		<dc:creator><![CDATA[Murhaf Fares]]></dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Comperio]]></category>
		<category><![CDATA[search technology]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=2795</guid>
		<description><![CDATA[If you are a new graduate, or about to graduate, and wondering what is it like to be working with search technology at Comperio, read this interview with UiO (University of Oslo): For eksempel kan jeg hjelpe et selskap med å lage bedre søk for å finne informasjon internt i organisasjonens datasystem. Det første jeg [...]]]></description>
				<content:encoded><![CDATA[<p>If you are a new graduate, or about to graduate, and wondering what is it like to be working with search technology at Comperio, read <a href="http://www.uio.no/studier/program/inf-sprok/karriereintervjuer/murhaf_fares.html" target="_blank">this interview with UiO</a> (University of Oslo):</p>
<blockquote><p>For eksempel kan jeg hjelpe et selskap med å lage bedre søk for å finne informasjon internt i organisasjonens datasystem. Det første jeg gjør er å sortere filene. Jeg «tagger» filene med relevant informasjon, som for eksempel hvem som har skrevet den eller hva slags prosjekt den tilhører. Problemet er ofte at man setter inn et ord for å beskrive en fil, og når man skal søke det opp bruker man et synonym. Slik informasjon er ikke alltid i filene, derfor må de behandles før de kan søkes opp.På den andre siden har du brukeren som vil finne filene.</p>
<p><img class="alignright size-medium wp-image-2799" src="http://blog.comperiosearch.com/wp-content/uploads/2014/08/murhaf-uio-blog-300x270.png" alt="murhaf-uio-blog" width="300" height="270" /><br />
Akkurat nå jobber jeg med å gjøre søkene bedre på brukersiden. Noen ganger vet ikke brukeren hva som er det beste nøkkelordet eller søkeordet for det hun eller han søker på. Da kan det for eksempel være nyttig å finne ut hvem som kan noe om temaet. Det vil si at vi kan linke søkeord med eksperter innenfor bedriften. Egentlig gjør vi søket lettere ved å tilgjengeliggjøre informasjon.</p>
<p><a href="http://www.uio.no/studier/program/inf-sprok/karriereintervjuer/murhaf_fares.html"><em>Les mer</em></a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2014/08/14/bygger-sokesystemer-naeringslivet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instant search with AngularJS and elasticsearch</title>
		<link>http://blog.comperiosearch.com/blog/2013/10/24/instant-search-with-angularjs-and-elasticsearch/</link>
		<comments>http://blog.comperiosearch.com/blog/2013/10/24/instant-search-with-angularjs-and-elasticsearch/#comments</comments>
		<pubDate>Thu, 24 Oct 2013 09:22:09 +0000</pubDate>
		<dc:creator><![CDATA[Murhaf Fares]]></dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[elastic.js]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=1826</guid>
		<description><![CDATA[Join our breakfast seminar in Oslo November 28th In this blog post we try to explain how to build a single-page application (SPA) to search in elasticsearch using AngularJS. For simplicity, we will use a twitter index which you can easily create yourself (see here and here). Angular is an open-source JavaScript framework maintained by [...]]]></description>
				<content:encoded><![CDATA[<address><a href="http://www.comperio.no/frokost131128" target="_blank">Join our breakfast seminar in Oslo November 28th</a></address>
<p><img class="alignright size-medium wp-image-1751" src="http://blog.comperiosearch.com/wp-content/uploads/2013/10/es-ang-300x191.png" alt="" width="300" height="191" />In this blog post we try to explain how to build a single-page application (SPA) to search in elasticsearch using <a title="AngularJS " href="http://angularjs.org/" target="_blank">AngularJS</a>. For simplicity, we will use a twitter index which you can easily create yourself (see <a href="https://github.com/s1monw/hammertime" target="_blank">here</a> and <a href="https://github.com/comperiosearch/elasticsearch-uio-demo/blob/master/examples/advanced/setup-twitter-river.md" target="_blank">here</a>).<br />
Angular is an open-source JavaScript framework maintained by Google. According to the official Angular website &#8220;Angular teaches the browser new syntax through a construct we call directives&#8221;&#8212;in other words, Angluar allows you to extend the HTML syntax to make your application &#8216;more dynamic&#8217;. With Angular, we can also build applications following the Model-View-Control (MVC) design pattern.</p>
<p>To communicate with elasticsearch, we rely on <a href="https://github.com/fullscale/elastic.js" target="_blank">elastic.js</a>, a JavaScript client for elasticsearch.</p>
<p>In this post, we assume some basic understanding of search concepts and Angular. If you are not familiar with Angular, see the further readings section.</p>
<h2>Sketching the structure out</h2>
<p>Angular applications, in general, consist of three types of components: models, views and controllers, and our application is no exception.<br />
The model in our application is, more or less, included within elastic.js, which sends requests to elasticsearch and returns the requested information as JSON objects. The views are <em>almost </em>plain HTML pages which allow the user to enter search queries and display the results of those queries. The controllers are mediators between elastic.js and the views. We have two views and two corresponding controllers for Twitter and Stackoverflow, but we will not be implementing the Stackoverflow part; we added it only for the sake of clarity.</p>
<p>The full code is on <a href="https://github.com/Murhaf/angular-elasticsearch-example">github</a>, you can start by looking at the general structure of the application and then come back here to understand how the different parts of this application work together.</p>
<h2>The single page in the single-page application</h2>
<p>Single-page applications contain, as the name suggests, one page whose content changes dynamically. This page is called <code>index.html</code> in our search application. The following code snippet shows the main parts of index.html.</p>
<script src="https://gist.github.com/7038944.js?file=index.html"></script>
<p>There are two important points to note about the code above. First, the Angluar directive <code>np-app</code> within the <code>&lt;html&gt;</code> tag which defines the boundary of the Angular application. Second, the <code>ng-view</code> directive which specifies where the different views will be rendered within the layout of index.html. Said differently, <code>ng-view</code> is &#8216;replaced&#8217; by the dynamic content in the main page.</p>
<h3>searchApp.js</h3>
<p>In each and every Angular application, there is at least one Angular module. &#8220;searchApp&#8221; is the sole and main module in our application, as indicated in <code>ng-app</code> above. The following piece of code defines this module with its dependencies.</p>
<script src="https://gist.github.com/7038944.js?file=searchApp.js"></script>
<p>The module searchApp depends on three other modules, namely: (1) elasticjs.service, the JavaScript client for elasticsearch, elastic.js, (2) <a href="http://docs.angularjs.org/api/ngSanitize" target="_blank">ngSanitize</a>, an Angular module to sanitize HTML, and (3) <a href="http://binarymuse.github.io/ngInfiniteScroll" target="_blank">infinite-scroll</a>, a directive to implement infinite scrolling in Angular.</p>
<p>We also need to configure the so-called routes, URLs linking to views and controllers. In concrete terms, we need to link the items in the navigation bar to HTML partials. To do so, we use the route service, <code>$routeProvider</code>. Observe that each route has a view, templateUrl, and a controller. Recall that we used the directive <code>ng-view</code> to define the dynamic part within the main page, <code>$routeProvider</code> and <code>ng-view</code> are used together to achieve this dynamic behavior.</p>
<h2>Twitter view</h2>
<p>The first thing we need in a search application is a search box, ha? The following code snippet defines an instant search box that calls a search function, <code>search()</code>, every time the input text is changed. This <code>search()</code> function will be defined later in the Twitter controller.</p>
<script src="https://gist.github.com/7040018.js?file=searchbox.twitter.html"></script>
<p>Observe that we bind the input text to a property named <code>queryTerm</code> using the Angular directive <code>ng-model</code>. This binding makes the input value available throughout the Angular application via an object called scope (<code>$scope</code>). It is noteworthy that binding in Angular is two-way, meaning that if the input text (queryTerm) is changed somewhere in the application this change will be directly reflected on the user interface and vice versa.<br />
Now let&#8217;s dive into how the search function works, and then we can come back to displaying the search results.</p>
<h2>Simple queries</h2>
<p>All the search functionalities are defined within the Twitter controller, TwitterController.js. We start by implementing a simple search function and then gradually enhance it. First, we define a controller named Twitter, which depends on <code>$scope</code> and <code>esjResource</code> (the elastic.js client).</p>
<script src="https://gist.github.com/7039581.js?file=TwitterController.js"></script>
<p>Within the twitter controller, we instantiate the elastic.js client, passing the URL of the local elasticsearch instance. All search requests to elasticsearch go through a <a href="http://docs.fullscale.co/elasticjs/ejs.Request.html" target="_blank">Request</a> object, <code>statusRequest</code>, which queries the specified index and type.<br />
Observe that we are using the binding <code>$scope.queryTerm</code> to access the search query. We use the <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html" target="_blank">match query</a> family in elasticsearch to search in the <code>_all</code> field for <code>$scope.queryTerm</code>. In addition, we define the fields to be returned by elasticsearch instead of returning full documents. Finally, the search results are appended to <code>$scope.resultArr</code> (again defined within the <code>$scope</code> to make accessible by the views).</p>
<p>With the code above, however, we only get the top ten results matching the user&#8217;s query, usually we want to show more than that, this is where pagination comes into play.</p>
<h3>Pagination with infinite scroll</h3>
<p>Each search request by elastic.js returns ten results by default, but the user&#8217;s information need might not be satisfied by the top 10 results, hence we want to allow the user to load more results if needed. The process of dividing the search results into different pages is called pagination. However, in this example, we will not implement the classic pagination, but instead we will use scrolling; whenever a user scrolls down and reaches the bottom of the page, a new search will be performed with an offset of <code>pege_number*result_per_page</code> and, consequently, a new set of results will be rendered.</p>
<script src="https://gist.github.com/7039581.js?file=pagination.js"></script>
<p>The function <code>show_more</code> will be called whenever the user scrolls down and hits the end of the page. Every time the function <code>show_more</code> is called, it increases the page number, and then calls another search function, <code>searchMore()</code>. The only difference between <code>searchMore()</code> and <code>search()</code> is that the latter defines an offset, <code>.from(offset)</code>.</p>
<h3>Highlighting</h3>
<p>Elasticsearch implements search result highlighting on one or more fields. In the following we define highlighting on the text field, and specify that for each hit the highlighted fragments should be <strong>in bold</strong>.</p>
<script src="https://gist.github.com/7039581.js?file=highlight.js"></script>
<p>The code above defines a <a href="http://docs.fullscale.co/elasticjs/ejs.Highlight.html" target="_blank"><code>Highlight</code></a> object, then passes it to the search request. No changes are required in the search function.</p>
<h2>Viewing, again</h2>
<p>Now that we have defined all the functions needed to send queries to elasticsearch, we can extend our view to display search results.<br />
<script src="https://gist.github.com/7040018.js?file=twitter.html"></script></p>
<p>The directive <code>infinite-scroll</code> specifies that the function <code>show_more()</code> should be called on scroll-down. The directive <a href="http://docs.angularjs.org/api/ng.directive:ngRepeat" target="_blank"><code>ng-repeat</code></a> is like an &#8216;iterative loop&#8217; that repeats the HTML template for each element in the collection specified, e.g. the directive <code>ng-repeat="doc in results.hits.hits"</code> iterates over all the hits returned by elastic.js from elasticsearch. Note that the array <code>resultArr</code> is accessible from the Twitter view because it was defined on the $scope object in TwitterController.js. <code>renderResult</code> and <code>renderResultMetadata</code> are JavaScript functions defined in TwitterController.js, both function return HTML, hence we need to sanitize their returned values using the directive <code>ng-bind-html</code>. We didn&#8217;t explain the functions <code>renderResult</code> and <code>renderResultMetadata</code> as they are straightforward.</p>
<p>In future posts, we will go through faceting with elasticsearch and Angular. If you are curious, though, the code on github already contains faceting.</p>
<h2>Further readings</h2>
<p><a href="http://www.fullscale.co/elasticjs/" target="_blank">elastic.js user guide</a><br />
<a href="http://www.fullscale.co/blog/2013/02/28/getting_started_with_elasticsearch_and_AngularJS_searching.html" target="_blank">Getting Started with elasticsearch and AngularJS: Part1 &#8211; Searching</a><br />
<a href="http://docs.angularjs.org/tutorial/" target="_blank">Angular tutorial &#8212; official website</a><br />
<a href="https://github.com/IgorMinar/foodme" target="_blank">Foodme: Angular example application</a></p>
<p>&nbsp;</p>
<h2><a href="http://www.comperio.no/frokost131128" target="_blank">Join our breakfast seminar in Oslo November 28th</a></h2>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2013/10/24/instant-search-with-angularjs-and-elasticsearch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Elasticsearch smashtime</title>
		<link>http://blog.comperiosearch.com/blog/2013/09/23/elasticsearch-smashtime/</link>
		<comments>http://blog.comperiosearch.com/blog/2013/09/23/elasticsearch-smashtime/#comments</comments>
		<pubDate>Mon, 23 Sep 2013 10:08:47 +0000</pubDate>
		<dc:creator><![CDATA[Murhaf Fares]]></dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[Kibana]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=1716</guid>
		<description><![CDATA[Last week, Comperio went to the University of Oslo to give the informatics students a brief introduction to elasticsearch and Kibana, so we tweeted and indexed our tweets in addition to many other tweets. Our tutorial, “smashtime”, is based on Simon Willnauer&#8217;s tutorial “hammertime” (hence the name), however we introduced some changes to make it [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Last week, Comperio went to the University of Oslo to give the informatics students a brief introduction to elasticsearch and Kibana, so we tweeted and indexed our tweets in addition to many other tweets.</strong></p>
<p><img class="alignright size-medium wp-image-1751" src="http://blog.comperiosearch.com/wp-content/uploads/2013/09/Screen-Shot-2013-09-23-at-2.34.13-PM-300x229.png" alt="Comperio Tutorial Smashtime" width="300" height="229" />Our tutorial, “<a href="https://github.com/comperiosearch/elasticsearch-uio-demo" target="_blank">smashtime</a>”, is based on Simon Willnauer&#8217;s tutorial “<a title="Hammertime" href="https://github.com/s1monw/hammertime" target="_blank">hammertime</a>” (hence the name), however we introduced some changes to make it meet our needs, e.g. hammertime uses <a href="https://github.com/elasticsearch/stream2es" target="_blank">stream2es</a> to index tweets but we used <a href="https://github.com/elasticsearch/elasticsearch-river-twitter" target="_blank">elasticsearch Twitter River</a> because the latter provides the ability to filter which tweets get indexed based on their hashtags, location etc.<br />
Hammertime ‘automates’ everything, meaning that two bash scripts will do the work for you: run elasticsearch, index tweets, query, and start Kibana. In smashtime, however, we wanted the students to learn how to run elasticsearch and Kibana, so our bash script will only download and configure elasticsearch together with a couple of elasticsearch plugins.</p>
<p>Smashtime went fairly well, most students were able to join our cluster and query the twitter index.<br />
We started the tutorial with indexing some ‘fake’ tweets using cURL requests. Then, we moved on to querying real tweets using match, phrase, and Boolean queries. After that, we showed how fast filters can be and how one can use facets to know who is tweeting on Justin Bieber, bah. Lastly, but perhaps most interestingly, we made sense of our tweets using Kibana, again, thanks to Simon’s hammertime dashboard.</p>
<p>In addition to introducing elasticsearch and Kibana, we used <a href="https://github.com/bleskes/sense" target="_blank">Sense</a>, a very useful, JSON aware tool* to send queries to elasticsearch. Among other things, Sense has a great autocomplete feature, if you haven’t tried it before, check it out!</p>
<p>We are looking forward to more workshops and tutorials on elasticsearch. We know, for Search.</p>
<p>*Sense is actually a chrome extension, but if you clone the repo you should be able to run it in any browser and you can also install as an elasticsearch plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2013/09/23/elasticsearch-smashtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
