code: def translate_facet_field(fcs, invert_subject_object = False):
      
      if 'facet_fields' not in fcs:
          return {}
      ffs = fcs['facet_fields']
      rs={}
      for (facet, facetresults) in ffs.items():
          if invert_subject_object:
              for (k,v) in INVERT_FIELDS_MAP.items():
                  if facet == k:
                      facet = v
                      break
                  elif facet == v:
                      facet = k
                      break
  
          pairs = {}
          rs[facet] = pairs
          for i in range(int(len(facetresults)/2)):
              (fv,fc) = (facetresults[i*2],facetresults[i*2+1])
              pairs[fv] = fc
      return rs
docs: Translates solr facet_fields results into something easier to manipulate
  
      A solr facet field looks like this: [field1, count1, field2, count2, ..., fieldN, countN]
  
      We translate this to a dict {f1: c1, ..., fn: cn}
  
      This has slightly higher overhead for sending over the wire, but is easier to use