Help:CirrusSearch elasticsearch replicas
Revision as of 17:09, 3 September 2019 by Ebernhardson (talk | contribs​)​(​→‎Accessing​)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Cloud Elastic is a replica of the CirrusSearch elasticsearch indices made available to Wikimedia Cloud Services applications (both Cloud VPS and Toolforge). These servers are not generally accessible from the internet at large, rather they are only accessible through applications running inside Cloud Services. Applications can use the full power of the elasticsearch search API's to query the search indices in ways that CirrusSearch does not expose directly on the wiki's themselves.
There are actually three clusters, named chi, psi and omega. chi contains approximately the 200 largest wikis. psi and omega contain equal splits of the remaining smaller wikis. Assignment of wikis to clusters is constant and is not expected to change.
Cluster NameURL
Clusters can be accessed through each other using the elasticsearch cross cluster search syntax. For example labswiki (wikitech's internal database name), which lives on the omega cluster, can be queried through the chi cluster with:
curl -XGET
A plausible method to programatically connect to the right cluster is to fetch the /_aliases end-point from each cluster. The cluster that contains indices for a wiki will have an alias matching the internal database name of the wiki. This alias will point to all related indices, such as labswiki_content and labswiki_general.
Indices Available
All wikis have two indices, of the format <dbname>_content and <dbname>_general. The content index contains all of the content namespaces of the wiki, the general index contains everything else. So for example on wikipedia's articles are found in the content index, and talk pages are found in the general index. Querying both indices can be done through an alias by providing only the wiki db name.
The set of indices that exist in a cluster can be queried through the elasticsearch cat indices API.
curl -XGET
See mw:Extension:CirrusSearch/Schema​.
Example Use Cases
Query all indices
curl -XGET*,*:*/_search?q=example
Query all content indices
curl -XGET*_content,*:*_content/_search?q=example
Fetch full document for single page by page id
curl -XGET
Fetch full document for single page by title
curl -XGET
View edit history of this page.
Content is available under CC BY-SA 3.0 unless otherwise noted.
Privacy policy
Terms of Use
HomeRandomLog in Settings DonateAbout WikitechDisclaimers