'Attempt to merge `host` with an existing record.
Return `True` if another record for the same address (and
source if `host[\'source\'] exists`) has been found, merged and
the resulting document inserted in the database, `False`
otherwise (in that case, it is the caller\'s responsibility to
add `host` to the database if necessary).'

def merge_host(self, host):

    try:
        flt = self.searchhost(host['addr'])
        if host.get('source'):
            flt = self.flt_and(flt, self.searchsource(host['source']))
        rec = self.get(flt)[0]
    except IndexError:
        return False
    self.store_host(self.merge_host_docs(rec, host))
    self.remove(rec)
    return True
