hotdog
hotdog copied to clipboard
Sort search results by fields
Sorted result provides better visibility of the results. This is especially useful when display_search_tags option is set and search expression includes wildecards. If display_search_tags is set and search expression doesn't include wildecards, result doesn't change at all because sorting is stable-sort.
Yes, by default, hotdog will not perform ordering of the result, unless there is some invocations of "order_by()" in the expression. I think sorting by default makes some sense, however, at the same time, sometime we might prefer to get the result in different ordering, that is the reason why the ordering fearure has been implemented as search expressions, IIRC.... Hmm. 🤔
https://github.com/yyuu/hotdog/blob/v1.20190725.0/lib/hotdog/expression/semantics.rb#L518-L519 https://github.com/yyuu/hotdog/blob/v1.20190725.0/lib/hotdog/expression/semantics.rb#L586-L600
yes. please use this PR in anyways as you would like.