Changes

Jump to navigation Jump to search
2,047 bytes added ,  19:55, 29 January 2016
interim draft on search extension
=== Native (Application) Search ===
Applications such as this wiki (mediawikiruns on MediaWiki), and CMS systems (e.g. Drupal) obviously know their own content. So, if you are looking for something and want the best results for those applications, you should make use of the direct search facilities in the application. # [[mw:Search]] helps you learn and understand the search capabilities of this system# Note that the simplest enhancement you can make to a small-scale installation is to tweak the MySQL stopwords and word-length. However, the built-in search capability of MediaWiki is actually not that great. See the section below on CirrusSearch Note that this wiki and the CMS systems also provide an 'OpenSearch' implementation that lets you use your browser's search toolbar to directly search these applications.
The MediaWiki system now includes a Ajax 'suggest' feature while you type in the search box. Setting is a UPO or User Preference Option that you control in your user settings.
If you're a sysop for a MediaWiki site, you probably want to install the [[wmmw:Extension:Replace_Text]] so that you can search and replace strings in your content. ==== Cirrus Search ==== To really get good search experience with MediaWiki, you should install the [[mw:Extension:CirrusSearch]]. To do so, first install the [[ElasticSearch]] system (you can use [https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html the repositories for that]). ElasticSearch is a Java application, so you need Java installed as well. <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.listsudo apt-get update && sudo apt-get install elasticsearchecho 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 check</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"}</source>
# [[mw:Search]] helps you learn and understand the search capabilities of this system
# The Lucene backend used on Wikipedia [[mw:Extension:Lucene-search]] can be used for large-scale installations where the built-in search is not sufficient. Note that the simplest enhancement you can make to a small-scale installation is to tweak the MySQL stopwords and word-length.
== General ==
4,558

edits

Navigation menu