samvera / questioning_authority

Question your authorities
Other
54 stars 30 forks source link

add ability to sort based on a numeric ranking predicate #152

Closed elrayle closed 6 years ago

elrayle commented 7 years ago

For linked data, the configuration can specify a predicate on which to sort the results when building the json list. Up to this point, these predicates have all been alpha strings. With the addition of a search rank predicate that returns a numeric value, there needs to be a numeric sort.

Example: "22", "1", "215"

alpha sort produces: "1", "215", "22" numeric sort produces: "1", "22", "215"

The new code checks if the both values being compared are numeric and does a numeric sort.