public function execute() { if ( !$this->inXmlMode() ) { // Pass back to the JSON defaults parent::execute(); return; } $params = $this->extractRequestParams(); $search = $params['search']; $limit = $params['limit']; $namespaces = $params['namespace']; // Open search results may be stored for a very long time $this->getMain()->setCacheMaxAge( 1200 ); $srchres = PrefixSearch::titleSearch( $search, $limit, $namespaces ); $items = array_filter( array_map( array( $this, 'formatItem' ), $srchres ) ); $result = $this->getResult(); $result->addValue( null, 'version', '2.0' ); $result->addValue( null, 'xmlns', 'http://opensearch.org/searchsuggest2' ); $result->addValue( null, 'Query', array( '*' => strval( $search ) ) ); $result->setIndexedTagName( $items, 'Item' ); $result->addValue( null, 'Section', $items ); }