Add ranking order to set higher priorities over rank#513
Add ranking order to set higher priorities over rank#513keymastervn wants to merge 1 commit intoCasecommons:masterfrom
Conversation
|
I need to order using a custom distance function, so this unfortunately isn't flexible enough. |
|
@futuretap I am still unclear on what your use case is, can you please provide me more context, perhaps a SQL query? SELECT earth_distance(
ll_to_earth(37.77492, -122.41942),
ll_to_earth(40.71278, -74.00595)
) AS distance_metersThen the option is simply In my case, I want to count the tsvector weight as well, so your change |
|
My order is using PostGIS: |
This PR changes how the gem is ranked by default
pg_search.rank DESC, followed up byorder_within_rankas the tiebreaker. Now, it supports ordering by other fields BEFOREpg_search.rankIn my case, ranking is not the most important to be considered first. For instance, we have options to sort by relevance order (1) AND posted date order (2). The requirement for (2) will respect the posted date order before another matching, similar to partitioning by date and apply ranking inside the partitions.
This option
ranking_ordersomehow is opposite toorder_within_rank, please suggest me a proper name.