Fix search for fields with numeric values #5356

This commit is contained in:
Charles Haley 2010-04-23 21:02:26 +01:00
parent 96c95279d1
commit 1dd8c22239

View File

@ -303,6 +303,7 @@ class ResultCache(SearchQueryParser):
IS_CUSTOM = [] IS_CUSTOM = []
for x in range(len(self.FIELD_MAP)): # build a list containing '' the size of FIELD_MAP for x in range(len(self.FIELD_MAP)): # build a list containing '' the size of FIELD_MAP
IS_CUSTOM.append('') IS_CUSTOM.append('')
IS_CUSTOM[self.FIELD_MAP['rating']] = 'rating' # normal and custom ratings columns use the same code
for x in self.custom_column_label_map: # add custom columns to MAP. Put the column's type into IS_CUSTOM for x in self.custom_column_label_map: # add custom columns to MAP. Put the column's type into IS_CUSTOM
if self.custom_column_label_map[x]['datatype'] != "datetime": if self.custom_column_label_map[x]['datatype'] != "datetime":
MAP[x] = self.FIELD_MAP[self.custom_column_label_map[x]['num']] MAP[x] = self.FIELD_MAP[self.custom_column_label_map[x]['num']]
@ -370,11 +371,6 @@ class ResultCache(SearchQueryParser):
matches.add(item[0]) matches.add(item[0])
continue continue
if rating_query:
if (loc == MAP['rating'] and rating_query == int(item[loc])):
matches.add(item[0])
continue
if IS_CUSTOM[loc] == 'rating': if IS_CUSTOM[loc] == 'rating':
if rating_query and rating_query == int(item[loc]): if rating_query and rating_query == int(item[loc]):
matches.add(item[0]) matches.add(item[0])