Open main menu

Changes

1,939 bytes added ,  12:16, 18 May 2020
add notes
This site uses Elasticsearch for it's search functionality under the hood.
{{Feature
|explainsimage= Search|description= This site uses Elasticsearch for the best possible search experience [[File:System-searchElasticsearch_logo.svg|linkimgdesc=Search|thumb|128px]]|notes=|tests=Search for something in "files" which indicates that PDF index results are returned instead of just articles. E.g. [https://wiki.freephile.org/w/index.php?title=Special:Search&profile=advanced&profile=advanced&fulltext=Search&search=ssh-agent&ns6=1 Search for 'ssh-agent' in the File namespace]|examples=
}}
{{#set:feature description = This site uses Elasticsearch for an amazing search experience! }}
{{#set:feature notes = [https://medium.com/@AIMDekTech/what-is-elasticsearch-why-elasticsearch-advantages-of-elasticsearch-47b81b549f4d The What, Why and Advantages of Elasticsearch] }}
{{#set:feature tests = Search for something in "files" which indicates that PDF index results are returned instead of just articles. E.g.[https://wiki.freephile.org/wiki/index.php?title=Special:Search&profile=advanced&profile=advanced&fulltext=Search&search=ssh-agent&ns6=1 Search for 'ssh-agent' in the File namespace] }}
{{#set:feature examples = }}
This site uses Elasticsearch for it's search functionality under the hood.
 
=== Search Tips ===
This wiki supports Elasticsearch features. So, for example, let's say you want to search for 'Ansible' in the wiki, but you know that there is an Ansible page, and you don't want to be taken directly to that page. Instead, you prefer to actually see all the [Special:Search search results for 'Ansible']. Just prefix your search term with the <code>~</code> character. Now when you press enter, you'll go to the search results page with a full listing of results. Use the <code>morelike:</code> special prefix [https://wiki.freephile.org/wiki/api.php?action=query&list=search&srsearch=morelike:Elasticsearch morelike:Elasticsearch]  Use the <code>cirrusdump</code> action to see the document as ElasticSearch sees it [{{fullurl:{{PAGENAMEE}}|action=cirrusdump}}]. This is especially useful to test whether (new) documents are being indexed. Additional MediaWiki API methods like <code>cirrus-config-dump</code> are listed at [[mw:Extension:CirrusSearch#API]]
{{Messagebox
{{Messagebox
| type = success
| text = Content as well as all files uploaded into the system are indexed. For example, [{{fullurl:Special:Search|search=fai|fulltext=Search|profile=all}} a search for "FAI"] lists both the [[Cloning]] article as well as the [[:File:Fai poster a4.pdf|PDF file]] And the file is not listed only because of the file name, but also because of the (indexed) file content. [{{fullurl:S pecialSpecial:Search|search=ed%20roman|fulltext=Search|profile=all}} A search for "Ed Roman"] will bring up the Enterprise Java Beans Design Patterns PDF file ([{{fullurl:File:Ejbdesignpatterns.pdf|page=13}} see p. 13 where Ed Roman is mentioned].)
}}
option httpclose
server es1 127.0.0.1:9200 weight 1 check inter 1000 rise 5 fall 1
 
</source>
 
You can add multi-wiki search like so using [https://github.com/wikimedia/mediawiki-extensions-CirrusSearch/blob/master/CirrusSearch.php $wgCirrusSearchEnableCrossProjectSearch], $wgCirrusSearchWikiToNameMap and $wgCirrusSearchInterwikiSources:
 
 
 
 
<source lang="php">
if ( $wikiId !== 'commons' ) {
$wgCirrusSearchEnableCrossProjectSearch = true;
$wgCirrusSearchWikiToNameMap = [
'commons' => 'wiki_commons',
];
$wgCirrusSearchInterwikiSources = [
'commons' => 'wiki_commons_content_first',
];
}
 
</source>
curl 'localhost:9200/_cluster/health?pretty=true'
curl 'localhost:9200/_cluster/state?pretty'
 
curl 'localhost:9200/_cat/indices?v'
</source>
== Monitoring ==
With the upgrade to Elasticsearch 5.x and 6.x, weplugins are deprecated. It're using s suggested to use Kibana as a monitoring and management interface to Elasticsearch.
<img src="http://meta.qualitybox.us:20000/api/v1/badge.svg?chart=elasticsearch_local.cluster_health_status&alarm=elasticsearch_last_collected&refresh=auto" />
Begin html
<html>
<embed src="http://meta.qualitybox.us:20000/api/v1/badge.svg?chart=elasticsearch_local.cluster_health_status&alarm=elasticsearch_last_collected&refresh=auto" type="image/svg+xml" height="20"/>
</html>
 
* Monitoring the Elastic Stack https://www.elastic.co/guide/en/elastic-stack-overview/6.4/xpack-monitoring.html
* Monitoring Settings https://www.elastic.co/guide/en/elasticsearch/reference/6.4/monitoring-settings.html
* X-Pack monitoring https://www.elastic.co/guide/en/kibana/current/xpack-monitoring.html
* Configuring Monitoring in Kibana https://www.elastic.co/guide/en/kibana/6.4/monitoring-xpack-kibana.html
* Monitoring with [https://github.com/lmenezes/cerebro Cerebro]
* You can still use [https://mobz.github.io/elasticsearch-head/ elasticsearch-head] if you use an SSH reverse tunnel to access the remote server.