src/Search.php
public function openSearch($search, $limit = null, array $namespace = null, $suggest = null, $format = null)
	{
		// Build the request.
		$path = '?action=query&list=search';

		if (isset($search))
		{
			$path .= '&search=' . $search;
		}

		if (isset($limit))
		{
			$path .= '&limit=' . $limit;
		}

		if (isset($namespace))
		{
			$path .= '&namespace=' . $this->buildParameter($namespace);
		}

		if (isset($suggest))
		{
			$path .= '&suggest=' . $suggest;
		}

		if (isset($format))
		{
			$path .= '&format=' . $format;
		}

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}
public function openSearch($search, $limit = null, array $namespace = null, $suggest = null, $format = null)
	{
		// Build the request.
		$path = '?action=query&list=search';

		if (isset($search))
		{
			$path .= '&search=' . $search;
		}

		if (isset($limit))
		{
			$path .= '&limit=' . $limit;
		}

		if (isset($namespace))
		{
			$path .= '&namespace=' . $this->buildParameter($namespace);
		}

		if (isset($suggest))
		{
			$path .= '&suggest=' . $suggest;
		}

		if (isset($format))
		{
			$path .= '&format=' . $format;
		}

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}
public function openSearch ( $ search , $ limit = null , array $ namespace = null , $ suggest = null , $ format = null ) { // Build the request. $ path = '?action=query&list=search' ; if ( isset ( $ search ) ) { $ path .= '&search=' . $ search ; } if ( isset ( $ limit ) ) { $ path .= '&limit=' . $ limit ; } if ( isset ( $ namespace ) ) { $ path .= '&namespace=' . $ this -> buildParameter ( $ namespace ) ; } if ( isset ( $ suggest ) ) { $ path .= '&suggest=' . $ suggest ; } if ( isset ( $ format ) ) { $ path .= '&format=' . $ format ; } // Send the request. $ response = $ this -> client -> get ( $ this -> fetchUrl ( $ path ) ) ; return $ this -> validateResponse ( $ response ) ; }
Method to search the wiki using opensearch protocol.

@param   string   $search     Search string.
@param   integer  $limit	     Maximum amount of results to return.
@param   array    $namespace  Namespaces to search.
@param   string   $suggest    Do nothing if $wgEnableOpenSearchSuggest is false.
@param   string   $format     Output format.

@return  object

@since   1.0
Method to search the wiki using opensearch protocol .