falcony-io / sqlalchemy-searchable

Fulltext searchable models for SQLAlchemy. Only supports PostgreSQL
Other
263 stars 44 forks source link

regconfig not used when sorting #75

Open siddhantgoel opened 5 years ago

siddhantgoel commented 5 years ago

In the search function, if the sort parameter is set to True, there's the following code snippet -

    query = query.filter(
        vector.op('@@')(sa.func.tsq_parse(regconfig, search_query))
    )
    if sort:
        query = query.order_by(
            sa.desc(
                sa.func.ts_rank_cd(
                    vector,
                    sa.func.tsq_parse(search_query)
                )
            )
        )

Is there a reason why regconfig is not used in the call to tsq_parse when applying the order_by clause? I'm noticing out-of-order results since I'm not using the default regconfig and suspect this might be the root cause.