def collect_results(self, terms):
        per_term_docs = {}
        per_doc_counts = {}

        for term in terms:
            term_matches = self.load_segment(term)

            per_term_docs.setdefault(term, 0)
            per_term_docs[term] += len(term_matches.keys())

            for doc_id, positions in term_matches.items():
                per_doc_counts.setdefault(doc_id, {})
                per_doc_counts[doc_id].setdefault(term, 0)
                per_doc_counts[doc_id][term] += len(positions)

        return per_term_docs, per_doc_counts
decorator which checks remote address
dataset/ETHPy150Open toastdriven/microsearch/microsearch.py/Microsearch.collect_results--crossover with--dataset/ETHPy150Open kapsiry/sikteeri/membership/decorators.py/trusted_host_required