Searching on the size column

This commit is contained in:
Kovid Goyal 2010-06-30 11:30:14 -06:00
commit 985cbb78e3
2 changed files with 9 additions and 2 deletions

View File

@ -341,8 +341,15 @@ class ResultCache(SearchQueryParser):
cast = lambda x : float (x)
adjust = lambda x: x
if len(query) > 1:
mult = query[-1:].lower()
mult = {'k':1024.,'m': 1024.**2, 'g': 1024.**3}.get(mult, 1.0)
if mult != 1.0:
query = query[:-1]
else:
mult = 1.0
try:
q = cast(query)
q = cast(query) * mult
except:
return matches

View File

@ -253,7 +253,7 @@ class FieldMetadata(dict):
'is_multiple':None,
'kind':'field',
'name':None,
'search_terms':[],
'search_terms':['size'],
'is_custom':False,
'is_category':False}),
('timestamp', {'table':None,