コード例 #1
0
	    'indent'       => 'on',
	    'q'            => $keyword,
	    'fq'           => implode( ' AND ', $filters ),
	    'start'        => '',
	    'rows'         => '15',
	    'fl'           => 'attr_headline_s',
	    'qt'           => 'ezpublish',
	    'explainOther' => '',
	    'hl.fl'        => '',
	    'sort'         => 'score desc',
	);

	$additionalParams = $resultHandler->solrHighlightParams();
	$params = array_merge( $params, $additionalParams );

	$results = solrTool::rawSearch( $params );

	$response = array(
		'term'       => $keyword,
		'count'      => $results['response']['numFound'],
		'result_url' => contextTool::instance()->domain() . '/' . $globalSearchURi . '/#?q=' . urlencode( $keyword )
	);

    ob_clean();

	switch( $responseFormat )
	{
		case 'xml':
			header( 'Content-Type: application/xml' );
			$xml = new SimpleXMLElement( '<response/>' );
			$xml->addChild( 'term', $response['term'] );