nodes: 0, module; 1, function_definition; 2, function_name:parse_sort_string; 3, parameters; 4, block; 5, identifier:sort; 6, expression_statement; 7, if_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, expression_statement; 12, return_statement; 13, comment:"""
      Parse a sort string for use with elasticsearch
  
      :param: sort: the sort string
      """; 14, comparison_operator:sort is None; 15, block; 16, assignment; 17, assignment; 18, identifier:se; 19, identifier:l; 20, block; 21, call; 22, identifier:sortlist; 23, identifier:sort; 24, None; 25, return_statement; 26, identifier:l; 27, call; 28, identifier:sortlist; 29, list; 30, expression_statement; 31, expression_statement; 32, expression_statement; 33, expression_statement; 34, expression_statement; 35, attribute; 36, argument_list; 37, list; 38, attribute; 39, argument_list; 40, assignment; 41, assignment; 42, assignment; 43, assignment; 44, call; 45, identifier:sortlist; 46, identifier:append; 47, string; 48, string; 49, identifier:sort; 50, identifier:rsplit; 51, string; 52, identifier:se; 53, call; 54, identifier:order; 55, conditional_expression:'desc' if se[0:1] == '-' else 'asc'; 56, identifier:field; 57, conditional_expression:se[1:] if se[0:1] in ['-', '+'] else se; 58, identifier:field; 59, call; 60, attribute; 61, argument_list; 62, string_content:_score; 63, string_content:_score; 64, string_content:,; 65, attribute; 66, argument_list; 67, string; 68, comparison_operator:se[0:1] == '-'; 69, string; 70, subscript; 71, comparison_operator:se[0:1] in ['-', '+']; 72, identifier:se; 73, attribute; 74, argument_list; 75, identifier:sortlist; 76, identifier:append; 77, dictionary; 78, identifier:se; 79, identifier:strip; 80, string_content:desc; 81, subscript; 82, string; 83, string_content:asc; 84, identifier:se; 85, slice; 86, subscript; 87, list; 88, identifier:field; 89, identifier:strip; 90, pair; 91, identifier:se; 92, slice; 93, string_content:-; 94, integer:1; 95, identifier:se; 96, slice; 97, string; 98, string; 99, identifier:field; 100, dictionary; 101, integer:0; 102, integer:1; 103, integer:0; 104, integer:1; 105, string_content:-; 106, string_content:+; 107, pair; 108, pair; 109, pair; 110, string:"order"; 111, identifier:order; 112, string:"unmapped_type"; 113, string:"string"; 114, string:"missing"; 115, string:"_last"
code: def parse_sort_string(sort):
      """
      Parse a sort string for use with elasticsearch
  
      :param: sort: the sort string
      """
      if sort is None:
          return ['_score']
      l = sort.rsplit(',')
      sortlist = []
      for se in l:
          se = se.strip()
          order = 'desc' if se[0:1] == '-' else 'asc'
          field = se[1:] if se[0:1] in ['-', '+'] else se
          field = field.strip()
          sortlist.append({field: {"order": order, "unmapped_type": "string", "missing": "_last"}})
      sortlist.append('_score')
      return sortlist