1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-14 13:54:53 +00:00

idea for weighted sorting

This commit is contained in:
Daniel 2023-05-09 00:36:41 +02:00
parent af40feee86
commit 9fc0d54fde

View File

@ -931,7 +931,15 @@ class CalibreDB:
func.partial_ratio(func.lower(Books.title),word)>=FUZZY_SEARCH_ACCURACY func.partial_ratio(func.lower(Books.title),word)>=FUZZY_SEARCH_ACCURACY
] ]
results=results.filter(or_(*filter_expression)) results=results.filter(or_(*filter_expression))
#TODO sort
# score = 0
# for word in words:
# score += max(
# attr1 % word,
# attr2 % word,
# )
# sort by score desc
return results return results
def get_cc_columns(self, config, filter_config_custom_read=False): def get_cc_columns(self, config, filter_config_custom_read=False):