Bug 627612: Search results for add-ons do not have the same order as returned by the AMO API. r=Unfocused

This commit is contained in:
Dave Townsend 2011-04-27 10:39:45 -07:00
parent c712fb1cbc
commit a38ede13b3
2 changed files with 6 additions and 6 deletions

View File

@ -1948,11 +1948,11 @@ var gSearchView = {
var elements = [];
function createSearchResults(aObjsList, aIsInstall, aIsRemote) {
aObjsList.forEach(function(aObj) {
let score = 0;
if (aQuery.length > 0) {
aObjsList.forEach(function(aObj, aIndex) {
let score = aObjsList.length - aIndex;
if (!aIsRemote && aQuery.length > 0) {
score = self.getMatchScore(aObj, aQuery);
if (score == 0 && !aIsRemote)
if (score == 0)
return;
}

View File

@ -212,8 +212,8 @@ function get_expected_results(aSortBy, aLocalExpected) {
var expectedOrder = null, unknownOrder = null;
switch (aSortBy) {
case "relevancescore":
expectedOrder = [ "remote4" , "addon2", "remote1" , "remote2",
"install2", "addon1", "install1", "remote3" ];
expectedOrder = [ "addon2" , "remote1", "install2", "addon1",
"install1", "remote2", "remote3" , "remote4" ];
unknownOrder = [];
break;
case "name":