#NEWLINE# def filter_version( version , app_id ) : #NEWLINE# #INDENT# '\n    Returns filters that can be sent to ES for app version ranges.\n\n    If the version is a alpha, beta, or pre-release this does an exact match.\n    Otherwise it will query where max >= M.Na and min <= M.N.\n    ' #NEWLINE# low = version_int ( version ) #NEWLINE# return { #NEWLINE# #INDENT# ( 'appversion.%s.min__lte' % app_id ) : low , #NEWLINE# #UNINDENT# }