Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort search results by fields #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frsyuki
Copy link
Contributor

@frsyuki frsyuki commented Aug 1, 2019

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.

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.
@yyuu
Copy link
Owner

yyuu commented Aug 1, 2019

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

@frsyuki
Copy link
Contributor Author

frsyuki commented Aug 2, 2019

yes. please use this PR in anyways as you would like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants