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:
parent
2864744bf3
commit
5f3ba78a26
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user