Changes

Jump to navigation Jump to search
4,842 bytes added ,  12:39, 30 January 2016
no edit summary
This site uses Elasticsearch for it's search functionality under the hood.
{{Feature
|explains= Search
|description= This site uses Elasticsearch for the best possible search experience [[File:System-search.svg|link=Search|thumb|64px]]
|notes=
|tests=
|examples=
}}
 
 
== About ==
Elasticsearch is a distributed RESTful search engine built for the cloud. Features include:
* Open Source under the Apache License, version 2 ("ALv2")
This site uses == Video ==* [https://vimeo.com/136326424 Building Elasticsearch: From Idea to {code} to Adoption] The back side of a napkin, a pen, and a few beverages are often the ingredients that yield good ideas. Elasticsearch had a different origin. It started with a need for a simple search box for a collection of recipes. '''Shay Banon''', creator of Elasticsearch and CTO at Elastic Search * https://www.elastic.co/about == Elasticsearch for MediaWiki ==To improve the out-of-the-box search experience with MediaWiki, you should install the [[mw:Extension:CirrusSearch]]. CirrusSearch is just a connector to the Elasticsearch engine. Thus, to use CirrusSearch, first install the [[Elasticsearch]] system (you can use [https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html the repositories for itthat]).  This system has three components: Elastica, CirrusSearch, and Elasticsearch.; Elastica : Elastica is a MediaWiki extension that provides the library to interface with Elasticsearch. It wraps the [https://github.com/ruflin/Elastica Elastica] library. It has no configuration.; CirrusSearch : CirrusSearch is a MediaWiki extension that provides search support backed by Elasticsearch.; Elasticsearch : is a Java application, so you need [[Java]] installed as well. At the time of this writing, there is a version mismatch. Elasticsearch is at version 2.1.1 in the repositories, but CirrusSearch is only compatible with the older 1.7 version. == Installation ==Here's search functionality under a quick example of how we got all the parts installed on an [[Ubuntu]] server.<source lang="bash"># is the curl extension to PHP installed?php -i |grep -C2 curl# no curl?sudo apt-get install php5-curlpushd extensionsjava -version# no javasudo apt-get install default-jre# need the jdksudo apt-get install default-jdk# add JAVA_HOME to /etc/environmentsudo update-alternatives --config javaecho 'JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java' |sudo tee -a /etc/environmentsource /etc/environmentecho $JAVA_HOMEwget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list#### don't do this because 2.1.1 is too new#### sudo apt-get update && sudo apt-get install elasticsearch#### get the 1.7.x version and install thatwget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.4.debsudo dpkg -i elasticsearch-1.7.4.debecho PATH=$PATH:/usr/share/elasticsearch/bin/ | sudo tee -a /etc/environmentsource /etc/environmentwhich elasticsearchsudo service elasticsearch start# check with curl (see below)# using SysV initsudo update-rc.d elasticsearch defaults 95 10git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/CirrusSearch.gitgit clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Elastica.gitcd Elasticacomposer install# load Special:Version to checksudo -u www-data php ./w/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.phpsudo -u www-data php /var/www/freephile.com/www/w/extensions/CirrusSearch/maintenance/forceSearchIndex.php --skipLinks --indexOnSkipsudo -u www-data php /var/www/freephile.com/www/w/extensions/CirrusSearch/maintenance/forceSearchIndex.php --skipParse</source> Checking if elasticsearch is running<source lang="bash">curl -X GET http://localhost:9200/</source><source lang="javascript">{ "name" : "Carmella Unuscione", "cluster_name" : "elasticsearch", "version" : { "number" : "2.1.1", "build_hash" : "40e2c53a6b6c2972b3d13846e450e66f4375bd71", "build_timestamp" : "2015-12-15T13:05:55Z", "build_snapshot" : false, "lucene_version" : "5.3.1" }, "tagline" : "You Know, for Search"}// second time around with the hoodolder version installed{ "status" : 200, "name" : "Richard Rider", "cluster_name" : "elasticsearch", "version" : { "number" : "1.7.4", "build_hash" : "0d3159b9fc8bc8e367c5c40c09c2a57c0032b32e", "build_timestamp" : "2015-12-15T11:25:18Z", "build_snapshot" : false, "lucene_version" : "4.10.4" }, "tagline" : "You Know, for Search"}</source> == Resources ==* https://phabricator.wikimedia.org/diffusion/ECIR/browse/master/CirrusSearch.php* https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FCirrusSearch.git/HEAD/README* https://wikitech.wikimedia.org/wiki/Search
[[Category:Search]]
4,558

edits

Navigation menu