def _search_index(self, fp, length):
        # index search
        fp_query = self.db.execute(sql.select([sql.func.acoustid_extract_query(fp)])).scalar()
        if not fp_query:
            return []
        with closing(self.idx.connect()) as idx:
            results = idx.search(fp_query)
            if not results:
                return []
            min_score = results[0].score * 0.1 # at least 10% of the top score
            candidate_ids = [r.id for r in results if r.score > min_score]
            if not candidate_ids:
                return []
        # construct the query
        condition = schema.fingerprint.c.id.in_(candidate_ids)
        query = self._create_search_query(fp, length, condition)
        # database scoring
        matches = self.db.execute(query).fetchall()
        return matches
dataset/ETHPy150Open lalinsky/acoustid-server/acoustid/data/fingerprint.py/FingerprintSearcher._search_index/original