Quote:
Originally Posted by DaiTengu
Yeah, they're supposed to be sorted by date. Apparently I'm not the only person having the problem.
|
When I wrote a search against oanother (non forum database) and I added sort by date I discovered that the place that the sort type is set matters.
ie
////////////
// do query
////////////
$cl = new SphinxClient ();
$cl->SetServer ( $sphinx_server, $sphinx_port );
$cl->SetWeights ( array ( 100, 1 ) );
// Number of results to display //
$cl->SetLimits ( intval(0), intval($limit) );
// $cl->SetMatchMode ( $any ? SPH_MATCH_ANY : SPH_MATCH_ALL );
$cl->SetMatchMode ( $sp_srch );
$cl->SetSortMode ( $sp_sort );
$cl->SetGroups ( $groups );
$cl->SetGroups2 ( $groups2 );
$cl->SetGroups3 ( $groups3 );
$cl->SetGroups4 ( $groups4 );
$cl->SetGroups5 ( $groups5 );
$res = $cl->Query ( $q, $index );
Works for me byt putting the "SetSortMode" below Group 5 didn't work not sure why

But it might be worth checking where it appears.