http://sphinxsearch.com
http://drupal4hu.com/node/129
" ... sql_query_range = SELECT MIN(nid), MAX(nid) FROM node
sql_range_step = 1000
sql_query = \
SELECT n.nid, n.title, body, changed \
FROM node n \
INNER JOIN node_revisions USING(vid) \
WHERE n.nid BETWEEN $start AND $end AND status = 1
...
require_once ('./sphinxapi.php');
$start_from = $_GET['page'] ? $_GET['page'] : 0;
$index = ...;
$page_increment = 10; // number of nodes shown
$amount = 10;
$sphinx = new SphinxClient ();
$sphinx->SetServer ('localhost', 3312);
$sphinx->SetWeights (array(100, 1));
$sphinx->SetMatchMode (SPH_MATCH_ALL);
$sphinx->SetLimits($start_from * $page_increment, $page_increment);
$sphinx->SetSortMode(SPH_SORT_TIME_SEGMENTS, 'changed');
// you can add filters with $sphinx->SetFilter etc
$result = $sphinx->Query(implode(' ', $keys), $index);
...
"
Friday, June 20, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment