This module simplyfies making API requests to your SearchBlox Search Engine API endpoint.
- Kohana 3.2.x
- SearchBlox 7.x
-
Checkout/download files and folders to
MODPATH/searchblox
. -
Add this entry under
Kohana::modules
array in yourAPPPATH/bootstrap.php
:'searchblox' => MODPATH.'searchblox', // SearchBlox
This module requires no configuration.
// Initiate SearchBlox
$searchblox_api_url = 'http://example.com:8180/searchblox/servlet/SearchServlet';
$searchblox = new SearchBlox_Query($searchblox_api_url);
// Define query parameters
$query_params = array(
// Search only within documents of a given type.
// Refer to SearchBlox manual to get the list of all formats available.
// Default: empty (all formats)
'contenttype' => '',
// Number of results per page.
// Default: 10
'pagesize' => 15,
// Results page number.
// Default: 1
'page' => 2,
);
// Optionally define collection ID.
// By default returning results from all collections.
// $searchblox->col = 3;
// Make the request
$query = $_GET['search_phrase'];
$query_result = $searchblox->search($query, $query_params);
foreach ($query_result->results as $doc)
{
// Parse your results
}
This module includes SimpleDOM class.