Hi Julie,
I think you got the same issue as
[AJAXSEARCH-6] : Sort with order and ranking parameters. Results with a wrong order.
In fact, the ranking couldn’t work with the non-ajax mode when the pagination occurs.
With release 1.8.1, in the file classes/ajaxSearch.class.inc.php replace the lines:
// output results in searchResults array
$useLimit = ($this->cfg['grabMax'] > 0)? $this->offset + $this->cfg['grabMax'] : $nbrs;
for ($y = $this->offset; ($y < $useLimit) && ($y < $nbrs); $y++) {
$moveToRow = mysql_data_seek($rs,$y);
$row = $modx->db->getRow($rs);
$result = $this->addExtractToRow($row);
$this->searchResults[] = $result;
if ($this->dbgRes) $this->asDebug->dbgLog($result,"AjaxSearchPopup - Output results before ranking");
}
// sort search results by rank if needed
$this->sortResultsByRank($this->searchString,$this->advSearch);
by
// output results in searchResults array
while ($row = mysql_fetch_assoc($rs)) {
$result = $this->addExtractToRow($row);
$this->searchResults[] = $result;
if ($this->dbgRes) $this->asDebug->dbgLog($result,"AjaxSearch - Output result before ranking"); // search results
}
// sort search results by rank if needed
$this->sortResultsByRank($this->searchString,$this->advSearch);
// limit the search results to the current page
$length = ($this->cfg['grabMax'] > 0)? $this->cfg['grabMax'] : $nbrs;
$this->searchResults = array_slice($this->searchResults,$this->offset,$length);
Or simply drop in the snippets/ajaxSearch/classes folder the attached file.
The release 1.8.2 integrates this update. To compare the results between 1.8.1 (before fixing) and 1.8.2 try to search "education" on these demo pages and compare the results.
1.8.1 version - With order and rank parameters
1.8.2 version - With order and rank parameters
Let me know if you have solved your issue.