/**
  * Used during indexing to retrieve multiple pages in JSON format.
  */
 public function getPages()
 {
     $this->wg->AllowMemcacheWrites = false;
     $ids = $this->getVal('ids');
     if (!empty($ids)) {
         $this->response->setData($this->wikiaSearchIndexer->getPages(explode('|', $ids)));
     }
     $this->getResponse()->setFormat('json');
 }
<?php

/**
 * This script is responsible for "handling" all closed wikis with respect to search in a batch process.
 * At this point, it means removing all documents from the index. 
 * 
 * @package MediaWiki
 * @addtopackage maintenance
 */
ini_set("include_path", dirname(__FILE__) . "/../../../../maintenance/");
require_once "commandLine.inc";
include_once "{$IP}/extensions/wikia/Search/WikiaSearch.setup.php";
$indexer = new WikiaSearchIndexer();
if (empty($wgExternalSharedDB)) {
    echo "This script should not run on a single-wiki instance.\n";
    die;
}
$dbr = wfGetDB(DB_MASTER, array(), $wgExternalSharedDB);
$select = $dbr->select('city_list', 'city_id', 'city_public < 1');
$rowCount = $select->numRows();
echo $rowCount . " closed wikis\n";
$counter = 1;
$wids = array();
foreach ($select as $row) {
    $wids[] = $row->city_id;
    if ($counter++ % 25 == 0) {
        $indexer->deleteManyWikiDocs($wids);
        echo "Handled {$counter}/{$rowCount} wikis\n";
        $wids = array();
    }
}