Wikia/app — pull request #171 by relwell (2012-11-28 19:32:03+00:00)
Title: Bugid 52358 -- support wiki public status changes in search

This change introduces a handful of new features around improving search index consistency with respect to closing and reopening a wiki:

* A new event type in Scribe called "reindex", that we will use to separate out search-specific updates to a particular page
* Methods in WikiaSearchIndexer to handle sending reindex messages through Scribe to the search backend in the case of a closed wiki reopening
* Methods in WikiaSearchIndexer to handle removing documents for a closed wiki from the search index
* A method in WikiaSearchIndexer keyed into the WikiFactoryPublicStatusChange hook that determines whether to reindex a wiki or delete its documents (note: called during a job, so please bear in mind when considering performance for the above methods)
* A script responsible for removing documents from all currently closed wikis from the search index
* Refactored the WikiEvaluationDataSource class from the dead wikis extension to give us a WikiDataSource class we can use to access a validated database handler and database name provided a wiki id (possible useful future additions: instantiation via hostname, via dbname, etc.)

This pull request was written in a TDD fashion, so it might be a good reference for future attempts at improving unit testing in other parts of the application.