def _process_facet_field_spies(self, spies):
        """
        Returns a dict of facet names with lists of
        tuples of the form (term, term_frequency)
        from a list of spies that observed the enquire.
        """
        facet_dict = {}
        for spy in spies:
            field = self.schema[spy.slot]
            field_name, field_type = field['field_name'], field['type']

            facet_dict[field_name] = []
            for facet in list(spy.values()):
                if field_type == 'float':
                    # the float term is a Xapian serialized object, which is
                    # in bytes.
                    term = facet.term
                else:
                    term = facet.term.decode('utf-8')

                facet_dict[field_name].append((_from_xapian_value(term, field_type),
                                               facet.termfreq))
        return facet_dict
def _process_facet_field_spies ( self , spies ) : facet_dict = { } for spy in spies : field = self . schema [ spy . slot ] field_name , field_type = field [ 'field_name' ] , field [ 'type' ] facet_dict [ field_name ] = [ ] for facet in list ( spy . values ( ) ) : if field_type == 'float' : term = facet . term else : term = facet . term . decode ( 'utf-8' ) facet_dict [ field_name ] . append ( ( _from_xapian_value ( term , field_type ) , facet . termfreq ) ) return facet_dict
Returns a dict of facet names with lists of
        tuples of the form (term, term_frequency)
        from a list of spies that observed the enquire.