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

Show search result most recent first #489

Open
johnfelipe opened this issue May 26, 2015 · 3 comments
Open

Show search result most recent first #489

johnfelipe opened this issue May 26, 2015 · 3 comments

Comments

@johnfelipe
Copy link

Example:

http://concejodemedellin.felipeurrego.com/search/?q=prado
18 de Junio de 2013 first

http://concejodemedellin.felipeurrego.com/search/?page=24&q=prado
19 de Julio de 2014 last

@dracos
Copy link
Member

dracos commented May 26, 2015

The search orders by relevance by default, because we don't know if you will have customised your search engine to return results in an order that you have changed in some fashion for your particular installation. I agree it should have a "sort by recent" option, similar to what we have on TheyWorkForYou. Then we would need a way for someone to specify if they wanted that ordering by default.

@johnfelipe
Copy link
Author

i havent customization in search engine, please teach me how custom "sort by recent" option, tnks

@dracos
Copy link
Member

dracos commented May 26, 2015

The best solution would be for you to implement this for all users of the code and submit it to us as a pull request. You would need to add an element to the form on a search results page allowing people to switch sort by recent/relevance, and pass that form entry to the search engine. This will involve you learning how to do it. If you do not want to implement it in a full manner that will help other users of the code, then you can find the build_form function in speeches/search.py, and alter sqs to add .order_by('-start_date') to it, which should do what you ask. If you cannot do that, you will have to wait until we or someone else has the time to implement it.

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