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

Sorting by field #4

Open
lucashpandolfo opened this issue Nov 23, 2015 · 2 comments
Open

Sorting by field #4

lucashpandolfo opened this issue Nov 23, 2015 · 2 comments

Comments

@lucashpandolfo
Copy link

Field sorting is not working at all.

I propose 3 changes:

First, this line is wrong. Should read (doc hit) instead of (doc hit1)

Next, this line should be totally removed.

And finally, in this line (make-instance 'sort :sort sort) should read (make-instance 'sort :fields sort)

Another minor improvements would be to either export the sort class or the reverse-p option and reversing the order of the string comparators, so the documents are ordered from a to z by default (without needing to explicitly pass :reverse-p t).
Anyway, changing those 3 lines enables field sorting, like

(montezuma:search *index* "title:wathever" :sort '("title"))
(montezuma:search *index* "title:wathever" :sort (make-instance 'montezuma::sort :fields '("title") :reverse-p t))

Thanks for mantaining Montezuma :)

@luismbo
Copy link
Member

luismbo commented Nov 23, 2015

Thanks for your report. Sending a pull request with the actual fixes you suggest would be helpful.

@lucashpandolfo
Copy link
Author

Done, Pull Request #5

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

No branches or pull requests

2 participants