Changed SearchResult.score to be the document percentage score instead of the weight. Added a new attribute that is the weight.

This commit is contained in:
David Sauve 2010-01-19 15:27:16 -05:00
parent 2864744bf3
commit 5f3ba78a26

View File

@ -375,7 +375,7 @@ class SearchBackend(BaseSearchBackend):
)
}
results.append(
SearchResult(app_label, module_name, pk, match.weight, **model_data)
SearchResult(app_label, module_name, pk, match.percent, weight=match.weight, **model_data)
)
if facets:
@ -471,7 +471,7 @@ class SearchBackend(BaseSearchBackend):
document = match.get_document()
app_label, module_name, pk, model_data = pickle.loads(document.get_data())
results.append(
SearchResult(app_label, module_name, pk, match.weight, **model_data)
SearchResult(app_label, module_name, pk, match.percent, weight=match.weight, **model_data)
)
return {