def _create_cache(self, cache_path, cache_id): # create a cache cm = XapianCacheManager(cache_path, id=cache_id) cache_sample = CACHE_SAMPLES[cache_id] for querydata in cache_sample: cm.set_queryid(querydata["queryrepr"], querydata["queryid"]) cm.set_hits(querydata["queryid"], querydata["docids"]) cm.flush() cm.close()