def _create_search_query(self, fp, length, condition):
        # construct the subquery
        f_columns = [
            schema.fingerprint.c.id,
            schema.fingerprint.c.track_id,
            sql.func.acoustid_compare2(schema.fingerprint.c.fingerprint, fp,
                                       self.max_offset).label('score'),
        ]
        f_where = sql.and_(
            condition,
            schema.fingerprint.c.length.between(self.max_length_diff - length,
                                                length + self.max_length_diff))
        f = sql.select(f_columns, f_where).alias('f')
        # construct the main query
        columns = [f.c.id, f.c.track_id, schema.track.c.gid.label('track_gid'), f.c.score]
        src = f.join(schema.track, schema.track.c.id == f.c.track_id)
        return sql.select(columns, f.c.score > self.min_score, src,
                           order_by=[f.c.score.desc(), f.c.id])
dataset/ETHPy150Open lalinsky/acoustid-server/acoustid/data/fingerprint.py/FingerprintSearcher._create_search_query/swapped operands of `-`