Skip to content

Commit

Permalink
Fixed low ranking bug - caused by overflowing weight because of large…
Browse files Browse the repository at this point in the history
… field weights (#32).

Field weights were decreased into lower number, but still has the same priority falling.
  • Loading branch information
MartinMikita committed Sep 9, 2016
1 parent 6510cd0 commit 1c4ea01
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions web/websearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,44 +469,44 @@ def search(orig_query, query_filter, autocomplete=False, start=0, count=0,
if autocomplete:
index_modifiers.append( ('ind_name_exact',
modify_query_autocomplete,
'name = 60000, alternative_names = 50000',
'name = 1000, alternative_names = 990',
) )
index_modifiers.append( ('ind_name_prefix',
modify_query_autocomplete,
'name = 50000, alternative_names = 40000',
'name = 900, alternative_names = 890',
) )
index_modifiers.append( ('ind_name_exact',
modify_query_orig,
'name = 40000, alternative_names = 30000',
'name = 800, alternative_names = 790',
) )
index_modifiers.append( ('ind_name_prefix',
modify_query_orig,
'name = 30000, alternative_names = 20000',
'name = 700, alternative_names = 690',
) )
index_modifiers.append( ('ind_name_exact',
modify_query_remhouse,
'name = 20000, alternative_names = 15000',
'name = 600, alternative_names = 590',
orig_query,
) )
index_modifiers.append( ('ind_name_prefix',
modify_query_remhouse,
'name = 10000, alternative_names = 9000',
'name = 500, alternative_names = 490',
orig_query,
) )

# 2. Prefix on names
if autocomplete:
index_modifiers.append( ('ind_names_prefix',
modify_query_autocomplete,
'name = 4000, alternative_names = 3900, display_name = 400',
'name = 300, alternative_names = 290, display_name = 70',
) )
index_modifiers.append( ('ind_names_prefix',
modify_query_orig,
'name = 2000, alternative_names = 1900, display_name = 200',
'name = 200, alternative_names = 190, display_name = 60',
) )
index_modifiers.append( ('ind_names_prefix',
modify_query_remhouse,
'name = 1000, alternative_names = 900, display_name = 100',
'name = 100, alternative_names = 95, display_name = 50',
orig_query,
) )

Expand All @@ -530,15 +530,15 @@ def search(orig_query, query_filter, autocomplete=False, start=0, count=0,
if autocomplete:
index_modifiers.append( ('ind_names_infix_soundex',
modify_query_autocomplete,
'name = 400, alternative_names = 390, display_name = 40',
'name = 90, alternative_names = 89, display_name = 40',
) )
index_modifiers.append( ('ind_names_infix_soundex',
modify_query_orig,
'name = 200, alternative_names = 190, display_name = 20',
'name = 70, alternative_names = 69, display_name = 20',
) )
index_modifiers.append( ('ind_names_infix_soundex',
modify_query_remhouse,
'name = 100, alternative_names = 90, display_name = 10',
'name = 50, alternative_names = 49, display_name = 10',
orig_query,
) )
# 4. If no result were found, try splitor modifier on prefix and infix soundex
Expand Down

0 comments on commit 1c4ea01

Please sign in to comment.