'Returns a dictionary of all of the stored fields from the SearchIndex.
Useful for serializing results. Only returns the fields Haystack\'s
indexes are aware of as being \'stored\'.'

def get_stored_fields(self):

    if (self._stored_fields is None):
        from haystack import connections
        try:
            index = connections[u'default'].get_unified_index().get_index(self.model)
        except NotHandled:
            return {}
        self._stored_fields = {}
        for (fieldname, field) in index.fields.items():
            if (field.stored is True):
                self._stored_fields[fieldname] = getattr(self, fieldname, u'')
    return self._stored_fields
