Search/Old

This page describes the Wikimedia Foundation's activities surrounding our sites' search functionality.

Rationale
The Wikimedia search infrastructure hasn't had significant development work for many years. The current system is based on homegrown layer on top of Lucene (lsearchd) that has since been tackled by much larger projects such as Solr and Elasticsearch. The search system frequently breaks in ways that are difficult to diagnose, and generally makes our Operations staff sad.

Goals for our current effort:
 * Make our existing tools more robust
 * Improve logging in our existing tools to make problems easier to diagnose
 * Migrate away from lsearchd to Solr (or something similar)

Our current search infrastructure is highly outdated and difficult to manage due to tons of custom code. We'd like to replace it with Solr (also based on Lucene), as it's very stable, contains many of the features we need, and doesn't require nearly as much custom code to support.

Timeline
This page is a timeline for future deployments of Cirrus (as secondary or primary) backends to wikis. Our general goal is to deploy CirrusSearch (backed by Elastic Search) by the end of 2013.

Primary backend

 * test2wiki - Aug 15
 * mediawikiwiki - Sep 11
 * ikwiktionary to primary - Sep 23
 * All disabled wikis - Sep 24
 * cawiki
 * enwikisoucre - Oct 15

Secondary backend

 * itwiktionary - Sep 16
 * enwikisource to secondary - Sep 23
 * cawiki - Sep 23
 * Wikidata - October 29th

Other

 * Upgrade Elasticsearch to 0.90.4 - Sep 18

Near term to be scheduled

 * to be determined

Solr vs Elasticsearch
We spent some time looking at search systems we could use and it became pretty apparent that the thought leaders in the open source world for search are Solr and Elasticsearch. We spent a few weeks with each and decided to build on Elasticsearch because of its wonderful suggester, easilly composable queries, good documentation. We are also happy with the process of submitting changes upstream to Elasticsearch.

Core Search
We're working feverishly on CirrusSearch and we're deploying it to wikis on a volunteer basis. We're actively looking for new volunteers so if you want in email neverett@wikimedia.org.

GeoData
We've just started looking at how to move GeoData to Elasticsearch. For now, it'll remain in Solr with plans to migrate it to Elasticsearch when time permits. Some considerations:

The index is relatively small (so no need to make it distributed), but requires a lot of computational power to work with. Full-text search is not currently used. Currently, data from all the wikis is stored in the same core, in the future we will need to split data to many cores (the puppet changes for using multiple cores with shared configuration/schema are here, needs more work).
 * Load expectations: unclear, but will be high if we start using it heavily e.g. for maps display.
 * Backups: not really needed - if master is down just switch to a slave. If all servers are down, reindexing from scratch is quick.
 * Note: because GeoData's schema is very stripped-down, /admin/ping doesn't work - should be remembered if someone wants to rewrite the current monitoring.

Nice to haves

 * A pony

Search Weighting Ideas
Some things that could be factored into search results, in no particular order
 * GeoLoc of user when searching
 * articles nearness (geographically) to current article
 * User's recent searches
 * We don't track user's search history, like we don't track user's pageviews
 * Sure, we don't track individual users search history, but do/can we search history in aggregate or generalized cohorts?
 * User's watched pages
 * User page view history (Not a thing)
 * You point out this isn't a thing, and rightly so.
 * It could be a thing (already is in legacy mobile app, will still be in new mobile app, currently stored in app, not profile, this may change)
 * External search referrer terms saved into article metadata (Not a thing, yet)
 * User's contribution history
 * Top searches in the last hour/day/week
 * Search terms that were followed vs unfollowed
 * Recent pages arrived at via external search
 * Ponies
 * Wikidata related items
 * Article recency
 * Article quality (per wikiprojects)
 * Article importance (per wikiprojects)
 * Article "meshiness" (no. articles that link to article, no. of articles that articles links to)
 * Matches in Title, Headings, Body Text, Alt-text, References (weighted differently)
 * Articles linked from current page
 * Content which received many thanks
 * Categories on Articles
 * Content with article issue templates
 * Stub status
 * Call to actions (# of article issues, missing images, etc)
 * In-article searches (when I'm reading an article, I want to search within it)
 * Recency of last edit
 * Notability of an article (i.e. featured)
 * Other wiki search results

Documents

 * Search documentation on Wikitech: Search
 * Ram's setup instructions: wikitech:User:Ram/Search
 * Some notes from Brion in 2008
 * The MWSearch extension provides a SearchEngine subclass which contacts Wikimedia's Lucene-based search server. This replaces the older LuceneSearch extension which reimplemented the entire Special:Search page.
 * /2013-02 discussion - Discussion with Rainman about how the current system works

Links

 * Bugzilla